Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

jquery toggle (show/hide) based on selector

jquery toggle (show/hide) based on selector


I want to create animation based on Jquery, below is my code;

>items=document.querySelectorAll("#customers td span");
[​  02​​, ​11​​, ​  02​​, ​11​​]
>item=items[0]; // it has a parent tag  i want the whole row to blink (both spans)
​  02​​
alt=​"  02,Counter,11,2013-04-06 14:​59:​16"
"2013-04-06 14:59:16"

or in JQuery:

$(document).ready(function() {
        $("#customers, td, #span").each(function(){
                var dt=new Date($(this).children("span").attr("alt").split(",")[3]).getTime();
                    if(dt>$.now()-10*1000){ //am i right here??

every second i want to check for each element in items; if dtm > current time - 10 seconds, then it should hide after 500 ms and should show after 500ms.

the code above that i have will only blink one span, i want both of the elements to blink.. and this check should continue each 1 second.

can any one help me..


Problem courtesy of: Fayyaz Ali


Below is my final code;

Solution courtesy of: Fayyaz Ali


View additional discussion.

This post first appeared on CSS3 Recipes - The Solution To All Your Style Problems, please read the originial post: here

Share the post

jquery toggle (show/hide) based on selector


Subscribe to Css3 Recipes - The Solution To All Your Style Problems

Get updates delivered right to your inbox!

Thank you for your subscription