forked from elkarte/Elkarte
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
On-the-fly change of css to hide/show (jQuery), should work, not tested
Signed-off-by: emanuele <emanuele45@gmail.com>
- Loading branch information
1 parent
0ee0eab
commit 97945aa
Showing
1 changed file
with
3 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
97945aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That should be fine, but do note that doing the show/hide (vs css display block/none) is slower ... show/hide will make jquery remember /store the state of the display attribute of the element, but if you are not using / polling that state its just lost cycles.
97945aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It seems the two are more or less the same:
http://jsperf.com/jquery-show-hide222222222222222222222222222222222222 (yes, the name is correct :P)
Hoping the test I wrote is meaningful. Of course both are much slower than using "pure js" (I did the test, but jQuery was like 94% slower and the results were difficult to compare).
BTW the rest of the code is not that nice... I should rewrite it...
97945aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All how you define more and less 😃 ... but lets abuse jquery a bit ... http://jsperf.com/jquery-show-hide222222222222222222222222222222222222/2
Eeewwwwwww pure js! ... why when you know write 10 characters less code and have it run 99% slower :P
97945aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FF is basically the same...Chrome is so fast that compare them is useless! 😛
http://jsperf.com/jquery-show-hide222222222222222222222222222222222222/3
97945aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
And SeaMonkey is so slow that one wonders why anyone is using it 😄 Anyway the tests show there are faster options both jquery an pure ... all depends what you are doing with it that will determine if any change should even be considered.