gpt4 book ai didi

javascript - jquery 图层 slider : stop layerslider when mouseover on navigation bar (nav)

转载 作者:行者123 更新时间:2023-11-28 13:05:20 25 4
gpt4 key购买 nike

我正在使用 jquery layerslider,当我将鼠标悬停在导航栏 (nav) 上时想停止 layerslider。

// Java script code
$('document').ready(function()
{
// Calling LayerSlider on your selected element after the document loaded
$('#layerslider').layerSlider({
responsive: true,
animateFirstLayer:false,
autostart:false,
skin : 'default',
skinsPath : '/layerslider/skins/'
// showCircleTimer:false

});
$('.onHoverService').mouseover (function(){
autoStart : false
});
$('.onHoverService').mouseout (function(){
autoStart : true
});
});
//HTML code
<nav class="nav-inner">
<div class="background_logo"><a href="http://www.blacknova.com.au/">
<img class="horizontal_logo" src="<?php echo $this->webroot; ?>img/bnlogohorisontal.png" height="35" >
<!--<img class="home_logo" src="<?php echo $this->webroot; ?>img/home-button-white.png" height="25" >-->
</a> </div>
<?php echo $this->element('Menus/menuHeader');?>
<div class="servicedropdownMenu">

<?php echo $this->element('Menus/headerServices');?>

</div>
<div class="portfoliodropdownMenu">

<?php echo $this->element('Menus/headerPortfolio');?>

</div>


</nav>

我试过上面的代码,但它不能正常工作。我是新手。提前感谢您的帮助。

最佳答案

添加pauseOnHover: true,

例子:

    $('#layerslider').layerSlider({
responsive: true,
pauseOnHover: true,
animateFirstLayer:false,
autostart:false,
skin : 'default',
skinsPath : '/layerslider/skins/'
// showCircleTimer:false
});

关于javascript - jquery 图层 slider : stop layerslider when mouseover on navigation bar (nav),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20413175/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com