Slide div horizontally with easing

浪尽此生 提交于 2019-12-10 10:18:38

问题


I am looking to achieve a hide/show div where on mouse enter the div is shown but in a sliding left to right manner with easing.

Also i need the page to focus on the new div that just slided out / made visible.

Here is my script.

Any ideas on what i need to add?

<script>$("#box0").mouseenter(function () {
    $("#lSection2").show('slide').delay(5000); 
    $("#boxContent0").slideDown(3000);
    $("#boxContent0").focus();

});

$('#boxContent0').mouseleave(function() {
    $("#boxContent0").fadeOut(1000);     
    $("#lSection2").fadeOut(1000);
});</script>

 <div class="AdBox" id="box0">mouse over or click to view details</div>



 <div id="lSection2" style="display:none;"><div id="boxContent0"
 style="display:none;"  class="boxContent">
     <div align="left" style="">Win Big<br />
 - Ipad<br />
 - Holiday<br />
 - 1 Year Spa Treatments</div>
     <div></div>

回答1:


$(element).show('slide', { direction: 'left' }, 1000);
$(element).hide('slide', { direction: 'left' }, 1000);

http://docs.jquery.com/UI/Effects/Slide



来源:https://stackoverflow.com/questions/8128609/slide-div-horizontally-with-easing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!