基于选择器的jquery切换(显示/隐藏)

我想基于jquery创建动画,下面是我的代码;

>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​​ >tm=item.attributes.getNamedItem("alt"); alt=​" 02,Counter,11,2013-04-06 14:​59:​16" >dtm=tm.value.split(',')[3]; "2013-04-06 14:59:16" 

或者在JQuery中:

 $(document).ready(function() { window.setInterval(function(){ $("#customers, td, #span").each(function(){ if($(this).children("span").attr("alt")!=null) var dt=new Date($(this).children("span").attr("alt").split(",")[3]).getTime(); if(dt>$.now()-10*1000){ //am i right here?? console.log("animating"); $(this).parent().fadeOut("slow"); $(this).parent().fadeIn("slow"); } }); },1000); }); 

每一秒我想检查项目中的每个元素; 如果dtm>当前时间–10秒,那么它应该在500毫秒后隐藏并且应该在500毫秒后显示。

我上面的代码只会闪烁一个跨度,我希望两个元素都闪烁..这个检查应该每1秒继续一次。

谁能帮我..

谢谢..

以下是我的最终代码;