我已經成立了一個例子一個超級簡單的功能轉盤這裏:懸停暫停簡單的jQuery旋轉木馬
http://codepen.io/anon/full/myvAz
的問題是,我不能讓傳送帶停止在懸停旋轉。
即使它有一個設置的寬度和高度,我甚至不能在包含div的盤旋時觸發警報。 但是,如果我將懸停部分粘貼到控制檯中,我可以獲得警報。
它與其他代碼結合時似乎不會觸發。
任何幫助將感激地讚賞
感謝
繼承人的代碼:
<script>
// Main image carousel
$(document).ready(function(){
$("#headerMrS > div:gt(0)").hide();
var carouDiv = function(){
setInterval(function() {
$('#headerMrS > div:first')
.fadeOut(500)
.next()
.fadeIn(500)
.end()
.appendTo('#headerMrS');
}, 2000);
};
$(carouDiv());//Initialise the carousel function
$("#headerMrS").hover(function(){//Stop the carousel on hover
$(this).stop;
},function(){
$(this).resume;
});
//Direction Arrow links
$(".button-sales").click(function(){
$(".header").fadeOut(800);
$(".sales").animate({opacity:"show"},800);
});
$(".button-modern").click(function(){
$(".header").fadeOut(800);
$(".modern").animate({opacity:"show"},800);
});
$(".button-antique").click(function(){
$(".header").fadeOut(800);
$(".antique").animate({opacity:"show"},800);
});
});
<style>
#headerMrS {position:relative; height:150px; width:350px}
.header {position:absolute; top:0; left:0}
</style>
<div id="headerMrS">
<div class="header sales active">
<div class="header-content">
<img src="http://placehold.it/350x150/4787ed/ffffff" alt="" />
<div class="button-next button-antique">next</div>
<div class="button-prev button-modern">prev</div>
</div>
</div>
<div class="header antique">
<div class="header-content">
<img src="http://placehold.it/350x150/fc8a41/ffffff" alt="" />
<div class="button-next button-modern">next</div>
<div class="button-prev button-sales">prev</div>
</div>
</div>
<div class="header modern">
<div class="header-content">
<img src="http://placehold.it/350x150/e7376b/ffffff" alt="" />
<div class="button-next button-sales">next</div>
<div class="button-prev button-antique">prev</div>
</div>
</div>
哪個代碼?我只能在這裏看到一個鏈接... –