用jQuery按顺序显示元素

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了用jQuery按顺序显示元素相关的知识,希望对你有一定的参考价值。

http://net.tutsplus.com/tutorials/javascript-ajax/quick-tip-display-elements-sequentially-with-jquery/
  1. // Wrapping, self invoking function prevents globals
  2. (function() {
  3. // Hide the elements initially
  4. var lis = $('li').hide();
  5.  
  6. // When some anchor tag is clicked. (Being super generic here)
  7. $('a').click(function() {
  8. var i = 0;
  9.  
  10. // FadeIn each list item over 200 ms, and,
  11. // when finished, recursively call displayImages.
  12. // When eq(i) refers to an element that does not exist,
  13. // jQuery will return an empty object, and not continue
  14. // to fadeIn.
  15. (function displayImages() {
  16. lis.eq(i++).fadeIn(200, displayImages);
  17. })();
  18. });
  19. })();

以上是关于用jQuery按顺序显示元素的主要内容,如果未能解决你的问题,请参考以下文章

csharp 在Swashbuckle Swagger中,此片段允许按字母顺序显示操作。

scrapy按顺序启动多个爬虫代码片段(python3)

jQuery Slide Down 用 slice 显示更多

jquery将元素移动到随机顺序

如何按元素内容过滤解析的 XML 数据 [jQuery]

html 将以编程方式附加外部脚本文件的javascript代码片段,并按顺序排列。用于响应式网站,其中ma