我已将“animsition.js”集成到我的网站,它工作正常,但某些链接在“淡出”效果中不起作用。我发布我的代码:
<nav>
<div class="cbp-spmenu cbp-spmenu-vertical cbp-spmenu-right text-left" id="side-menu">
<!-- LOGO -->
<a class="animsition-link" href="../../index.html"><img src="../../assets/images/logo/logo_white2.png" alt="logo"></a>
<a href="#" class="close-menu"><i class="icon ion-ios-close-empty icon-close menu-close-btn text-white"></i></a>
<div class="top">
<div class="tr">LANGUAGE_</div>
<div><a class="animsition-link" href="#"><span class="uns lang">ITALIANO</span></a> <br>
<a class="animsition-link" href="#"><span class="current lang">ENGLISH</span></a></div>
</div>
<ul class="nav navbar-nav container animsition">
<div class="tr">MENU_</div>
<li><a class="animsition-link" href="../../index.html">HOME</a></li>
<li class="dropdown">
<a class="expander" href="#">
<span class="current">PROJECTS LIST</span></a>
<div class="content">
<ul role="menu">
<li>
<a href="#">
<span class="rec4">CapozziPaints</span>
</a>
</li>
</ul>
</div>
</li>
<li><a href="../../about.html" class="animsition-link">ABOUT</a></li>
<li><a href="#">COOKIE POLICY</a></li>
<ul class="nav navbar-nav">
<div class="tr">CONTACT ME_</div>
<li><a href="mailto:info@josedesign.it"><span class="rec3">info@josedesign.it</span></a></li>
<li><a href="#"><span class="text-white">+39 389.582.3119</span></a></li>
</ul>
</ul>
<!-- End navbar-nav -->
<p class="copyright grey">2017 JoseDesign.it<br>Proudly designed by Jose.</p>
</div>
</nav>
在我的标签之后,我已经插入了“”,但是像“Home”这样的链接,不会产生淡出效果。
另一个问题是我必须在这段代码中的“img”标签中插入一个“fadeIn”效果:
$(window).scroll(function() {
$.each($('img'), function() {
if ( $(this).attr('data-src') && $(this).offset().top < ($(window).scrollTop() + $(window).height() + 100) ) {
var source = $(this).data('src');
$(this).attr('src', source);
$(this).removeAttr('data-src');
}
})
})
我尝试了几种方法,滚动效果+显示图像效果很好,但是淡入效果不起作用。
有人可以帮助我吗?谢谢。