我有一個div,其中某些控件在從數據庫獲取數據後動態添加。 它有點新聞細節將被添加。我只是想讓這個消息自動滾動,這是我通過javascript實現的。使用javascript停止mouseover上的動畫
現在,如果我想停止mouseover上的動畫並繼續mouseout,我該如何修改javascipt。
這是我的html頁面:
<section id="secbody" runat="server" style="position:absolute; background-color:dimgray; max-height:183px; min-height:183%;margin-top:14px;margin-left:545px;width:535px;">
<div id="galheader" style="width:535px;" runat="server">
<label id="Label1" style="color:White; position:absolute; font-size:20px; left:20px; height: 26px; width: 100%;" runat="server"> Upcoming Programs</label>
</div>
<section id="secdetails" runat="server" style="font-family:'Palatino Linotype';color:white; min-width:500px;overflow-wrap:break-word;background-attachment:fixed;position:absolute;margin-top:25px;"></section>
</section>
,這是我的javascript
<script type="text/javascript">
$(document).ready(function(){
function marqueePlay(){
$("#secdetails").animate(
{
top: $("#secbody").height() - $("#secdetails").height(),
opacity: 1
}, 4000, function(){
$("#secdetails").css("top", 1);
$("#secdetails").css("opacity", 1);
marqueePlay();
}
);
}
marqueePlay();
});
</script>
我知道我們需要使用.stop功能,但不知道使用它的正確方法。
你有沒有試過答案? –
@RajaprabhuAravindasamy ..我還有一個問題..你能幫我嗎.. –
是的,當然可以告訴我。 –