切换导航重叠问题

时间:2018-04-26 18:13:31

标签: jquery

我们如何实现"立即尝试"再次向右和向后按钮动画,不会在响应式屏幕中重叠切换导航?

条件是当我们向下滚动页面时,#panal div应该隐藏,我已经做过,但是当我们向上移动时,它应该显示Toggel Button&打开导航面板只有OnClick,我也做了,但在那种情况下立即尝试按钮动画有问题。那么,我们该如何解决呢?

http://testurproject.tk/deveod/EOD-New/home-sme.html

<script>
$(document).ready(function() {
var isMobile = "no";
if (/Android|webOS|iPad|iPhone|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent)) {
isMobile = "yes"
}
if (isMobile == "no") {
var btn_ffLife = !1;
$(".navbar-toggle").click(function() {
if (!btn_ffLife) {
$(".main-intro > .intro > .header-left-list .free-for-life").animate({
right: "32%"
}, 500);
btn_ffLife = !0
} else {
$(".main-intro > .intro > .header-left-list .free-for-life").animate({
right: "10%"
}, 800);
btn_ffLife = !1
}
});
$('body').scrollspy({
target: "header",
offset: 50
})
$(window).scroll(function() {
var scroll = $(window).scrollTop();
if (scroll >= 375) {
$("body").addClass("darkHeader");
$(".main-intro > .intro > .header-left-list .free-for-life").animate({
right: "10%"
}, 800)
} else {
$("body").removeClass("darkHeader");
$("#panel").css('display', 'none')
}
})
} else if (isMobile == "yes") {
$(".free-for-life2 img").css('width', '30%');
$(".free-for-life2").css('display', 'block')
}
});
</script>

1 个答案:

答案 0 :(得分:0)

现在已经解决了。最后我用cssText属性来解决这个问题。