简体   繁体   English

从上到下淡入页面元素

[英]fade in page elements from top-to-bottom

What are some good resources for fading in page elements from top to bottom? 从上到下淡入页面元素有哪些好的资源?

I have a Magento project where I have a several flexsliders and some other static elements, and I am interested in trying to fade in the different rows of elements from top to bottom as they load. 我有一个Magento项目,其中有几个flexsliders和一些其他静态元素,我有兴趣尝试在加载时从上到下淡入淡出不同的元素行。 Presently the static elements load and then the flexslider loads last, making the page loading inelegant. 当前,静态元素加载,然后flexslider加载最后,使得页面加载不美观。

Does anyone have some suggested plugins or similar resources that I can investigate? 有人有建议的插件或类似资源可供我调查吗? I am going to use lazy loading for some of the static images, but that doesn't solve the vertical loading problem. 我将对某些静态图像使用延迟加载,但这不能解决垂直加载问题。 Preferably based on jquery if not javascript straight. 最好基于jQuery,如果不是JavaScript直。

If you're trying to do something like fade in the first row, then the next row, then the next row, and so on, you can use a custom queue: 如果您尝试在第一行,第二行,第二行等中执行淡入淡出操作,则可以使用自定义队列:

// Set up your queue of fadeIns:
$(row_selectors).each(function() {
    $(this).queue(
        'fade_in_tans',
        function() {
            $(this).fadeIn().delay(delay_in_ms_if_desired).dequeue('fade_in_trans');
        }
    );
});
// now initiate the first fadeIn:
$(first_row_selector).dequeue('fade_in_tans');

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM