轻松水平滑动div [英] Slide div horizontally with easing

查看:122
本文介绍了轻松水平滑动div的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在寻找一种隐藏/显示div的功能,在该位置上单击鼠标可以显示div,但以从左到右的方式滑动并保持缓和.

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.

我还需要页面集中显示刚刚滑出/显示为新的div.

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

这是我的剧本.

关于我需要添加什么的任何想法?

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>

推荐答案

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

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

这篇关于轻松水平滑动div的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆