current location: Home > Download > JS effects > jQuery effects > jQuery search box input content to find whether the code in the table matches
jQuery search box input content to find whether the code in the table matches
Classify: JS effects / jQuery effects | Release time: 2018-05-17 | visits: 1113 |
Download: 47 |
Latest Downloads
Fantasy Aquarium
Girls Frontline
Wings of Stars
Little Flower Fairy Fairy Paradise
Restaurant Cute Story
Shanhe Travel Exploration
Love and Producer
The most powerful brain 3
Odd Dust: Damila
Young Journey to the West 2
24 HoursReading Leaderboard
- 1 This is the third part of this article. Here is the second part. A recent survey by Grayscale shows how voters perceive investment behaviors and the influence of crypto on their political outlook.
- 2 A Comprehensive Guide to ESnd Arrow Functions
- 3 JavaScript Control Structures
- 4 How to Handle iframes in Cypress
- 5 Miners Reduce Exchange Inflows, Signaling a Potential Bullish Trend for Bitcoin Recovery
- 6 DTX Exchange (DTX) Seen as a Market Disruptor
- 7 Pepe Unchained ($PEPU) Presale Raises $17M, Promises to Revolutionize Meme Coins with Layer 2 Blockchain
- 8 Pepe (PEPE) is climbing toward Dogecoin’s (DOGE) top spot, but analysts predict Rollblock (RBLK) could grow 1,000x by 2026
- 9 Robinhood Unveils New Feature Enabling European Customers to Transfer Their Crypto Assets
- 10 The Unbelievable Growth of CZ's Wealth: Behind the Prison Walls
- 11 Crypto Market Fairly Cautious, Here's Why
- 12 Why Is Flare (FLR) Price Pumping? Analyst Sights a 150% Rally
- 13 Pixelverse Introduces PixelTap Daily Combo Bonus: A Step-by-Step Guide
- 14 Factory Design Pattern in JavaScript
- 15 Explore all console features in JavaScript
Latest Tutorials
-
- Go language practical GraphQL
- 1742 2024-04-19
-
- 550W fan master learns JavaScript from scratch step by step
- 3165 2024-04-18
-
- Getting Started with MySQL (Teacher mosh)
- 1615 2024-04-07
-
- Mock.js | Axios.js | Json | Ajax--Ten days of quality class
- 2456 2024-03-29
code segment:
function search(){
// Get the value of the search box
var kwds = $("#searchInput").val();
// Get the first list content
var this_one = {};
var real_name = '';
// Define data list
var list = $("#all_list .list_one");
// Define the starting value for search
var true_one = 0;
for (var i = 0; i < list.length; i++) {
This_one = $(list[i]);
Real_name = this_one.text().toString();
// Execute like matching
If(real_name.match(kwds)){
// Process the current result
if(true_one == active){
// Get the width and height of the window
var windows_wdh = $(window).width();
var windows_hgt = $(window).height();
// Get the first coordinate
var x_len = this_one.offset().left;
var y_len = this_one.offset().top;
// Drive the scroll bar to scroll to the specified position
$("html,body").animate({scrollTop:(y_len-windows_hgt/2), scrollLeft:(x_len-windows_wdh/2)},500);
// Mark the currently selected results
This_one.addClass('active');
This_one.removeClass('on');
}else{
// Mark the matching results
This_one.addClass('on');
This_one.removeClass('active');
}
// Accumulate real choices
true_one++;
}else{
This_one.removeClass('on');
} }
}
// Determine whether the search is completed. If the search is completed, start from the first one, otherwise continue to search for the next one
active = active >= true_one-1 ? 0 : active+1;
Return false;
}