如何使用jquery设置革命滑块作为粘性标题的背景?

时间:2015-12-08 15:34:35

标签: jquery revolution-slider

我想将旋转滑块设置为粘性标题的背景。我希望它与此引用类似link。请帮我。提前谢谢。

粘贴标题的HTML代码

<div id="phantom" class="show-device-logo show-mobile-logo dt-parent-menu-clickable logo-left" style="top: 28px; opacity: 1; visibility: visible;">
<div class="ph-wrap with-logo">
    <div class="ph-wrap-content">
        <div class="ph-wrap-inner">
            <div class="logo-box">
                <a href="http://ecutopia.prithviinfosys.com/"><img src="http://ecutopia.prithviinfosys.com/wp-content/uploads/2015/10/logo1.png" height="61" width="200"></a></div><div class="menu-box">
                <ul id="main-nav" class="fancy-rollovers wf-mobile-hidden gradient-decor downwards-effect">
                    <li class="my_serchbox menu-item menu-item-type-custom menu-item-object-custom menu-item-31190 first menu-frame-on level-arrows-on"><form id="searchform" method="get" action="http://ecutopia.prithviinfosys.com"><div class="my_serch"><input type="text" placeholder="I`m Looking For ..." name="s" id="s" size="48" class="My_sebox"></div></form></li> 
                    <li class=" menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-30812 current_page_item menu-item-30915 act menu-frame-on level-arrows-on"><a href="http://ecutopia.prithviinfosys.com/"><span>HOME</span></a></li> 
                    <li class=" menu-item menu-item-type-post_type menu-item-object-page menu-item-31113 menu-frame-on level-arrows-on"><a href="http://ecutopia.prithviinfosys.com/services/"><span>SERVICES</span></a></li> 
                    <li class=" menu-item menu-item-type-post_type menu-item-object-page menu-item-31114 menu-frame-on level-arrows-on"><a href="http://ecutopia.prithviinfosys.com/industries/"><span>INDUSTRIES</span></a></li> 
                    <li class=" menu-item menu-item-type-post_type menu-item-object-page menu-item-31137 menu-frame-on level-arrows-on"><a href="http://ecutopia.prithviinfosys.com/home/home-blog/1-blog/"><span>BLOG</span></a></li> 
                    <li class=" menu-item menu-item-type-post_type menu-item-object-page menu-item-30645 menu-frame-on level-arrows-on"><a href="http://ecutopia.prithviinfosys.com/1-about-us/"><span>ABOUT US</span></a></li> 
                    <li class=" menu-item menu-item-type-post_type menu-item-object-page menu-item-30780 menu-frame-on level-arrows-on"><a href="http://ecutopia.prithviinfosys.com/3-contact/"><span>CONTACT US</span></a></li> 
                    <li class=" menu-item menu-item-type-custom menu-item-object-custom menu-item-31226 menu-frame-on level-arrows-on"><a href="http://srtechnologies.org/"><span>LOGIN</span></a></li> 
                </ul>
            </div>
        </div>
    </div>
</div>

代码我用来将滑块设置为粘贴标题的背景

jQuery(window).scroll(function() {    

    var scroll = jQuery(window).scrollTop();    
    if (scroll > 360) { 

        // jQuery('#phantom').addClass('main-slideshow'); 
        jQuery('<div>').attr('class', 'rv-slider').appendTo(jQuery('#phantom'));
    }

});

0 个答案:

没有答案