Comments (8)
There is no option for this because it is slow and distracting. You can use one of the slower alternatives if this is important, e.g. http://kilianvalkhof.com/uploads/listfilter/.
from jquery-fastlivefilter.
But can´t var oldDisplay = len > 0 ? lis[0].style.display : "block";
be changed to have a fadeIn() ?
Is it possible for me to alter the code a liitle bit ?
from jquery-fastlivefilter.
You're more than welcome to fork it, but the change isn't quite that simple (though it isn't too difficult): you'd just need to change all portions that reference li.style.display
into something else, maybe li.fadeIn()
or $(li).fadeIn()
(not sure which, you'd have to test it)
from jquery-fastlivefilter.
This is probably the change you'd need:
=== modified file 'jquery.fastLiveFilter.js'
--- jquery.fastLiveFilter.js 2011-11-07 22:06:24 +0000
+++ jquery.fastLiveFilter.js 2011-11-08 18:18:55 +0000
@@ -32,12 +32,14 @@
li = lis[i];
if ((li.textContent || "").toLowerCase().indexOf(filter) >= 0) {
if (li.style.display == "none") {
- li.style.display = oldDisplay;
+ $(li).fadeIn();
}
numShown++;
} else {
if (li.style.display != "none") {
- li.style.display = "none";
+ $(li).fadeOut();
}
}
}
It might be faster to use jQuery's .each()
instead of $(li)
inside the loop. For small data sets, it may not matter much.
from jquery-fastlivefilter.
Thank you.
This worked.
What did you mean with using each() instead of $(li) ?
Is it like this ? $li.each().fadeOut();
from jquery-fastlivefilter.
No, it'd be more like the examples in the jQuery each() API, but after glancing at it I don't think it'd be any faster.
from jquery-fastlivefilter.
ok. thank you.
Nice work.
from jquery-fastlivefilter.
No problem! Glad I could help.
from jquery-fastlivefilter.
Related Issues (19)
- Add option to highlight the keyword(s) in the string HOT 3
- Search not working on Tables HOT 1
- Filter is removing <a> tags from links HOT 1
- With very large lists, the DOM updates slowly when filtering up (clearing the query). HOT 6
- Possibility to have more than one input (add a selectbox or something)
- search on entire "nested" html markup HOT 1
- clear text button HOT 2
- Filter a set of tables based on text in a td of each table HOT 1
- Turkey "İ" problem HOT 1
- Reset x button does not work in IE HOT 1
- How to reinitialise plugin if DOM changes? HOT 4
- How to reverse the process, so that matching results are shown after being hidden HOT 1
- Not working in IE HOT 5
- Unable to work due to error
- Support HTML5 search inputs
- options argument isn't actually optional HOT 1
- Accents HOT 4
- IE hiding all items HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jquery-fastlivefilter.