我如何制作DIV幻灯片? [英] How can I make a DIV slide in and out?

查看:140
本文介绍了我如何制作DIV幻灯片?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在学习jQuery。我想知道如何在点击图片的边缘时滑动图片,然后再次点击并滑动。与此类似:

I am currently learning jQuery. I'd like to know how to make an image slide in when you click on its edge, then click again and it slides away. Similar to this:

http://www.karenmillen.com /

如果您看到右侧并单击,则会出现我在寻找的效果。我认为这将涉及到制作一个div,并给它一个背景图像,然后使用一些jQuery使div滑入视图。当然,div可以有其他内容,如html。任何想法?

If you see the right hand side and click, there is the effect that i'm looking for. I assume this will involve making a div and giving it a background image then using some jquery to make the div slide into view. Of course the div could have other content such as html. Any ideas?

.slideDown()方法是否有效?

Would the .slideDown() method work?

推荐答案

<如果你想要一个div来slideDown()首先它必须隐藏。
,所以使用 $(#div_Id)。hide();
之后使用 $(#div_Id ).slideDown( '慢');
这将工作

if you want a div to slideDown() first it has to hidden. so use $("#div_Id").hide(); after that use $("#div_Id").slideDown('slow'); this will work

这篇关于我如何制作DIV幻灯片?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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