【发布时间】:2012-10-12 13:20:07
【问题描述】:
谁能帮忙在此处找到的代码 sn-p 添加导航箭头
Slide a div offscreen using jQuery 并给出第一个答案....http://jsfiddle.net/jtbowden/ykbgT/2/
我希望能够添加方向箭头或上一个/下一个链接
代码如下
html:
<div id="container">
<div id="box1" class="box">Div #1</div>
<div id="box2" class="box">Div #2</div>
<div id="box3" class="box">Div #3</div>
<div id="box4" class="box">Div #4</div>
<div id="box5" class="box">Div #5</div>
</div>
css:
body {
padding: 0px;
}
#container {
position: absolute;
margin: 0px;
padding: 0px;
width: 100%;
height: 100%;
overflow: hidden;
}
.box {
position: absolute;
width: 50%;
height: 300px;
line-height: 300px;
font-size: 50px;
text-align: center;
border: 2px solid black;
left: 150%;
top: 100px;
margin-left: -25%;
}
#box1 {
background-color: green;
left: 50%;
}
#box2 {
background-color: yellow;
}
#box3 {
background-color: red;
}
#box4 {
background-color: orange;
}
#box5 {
background-color: blue;
}
javascript:
$('.box').click(function() {
$(this).animate({
left: '-50%'
}, 500, function() {
$(this).css('left', '150%');
$(this).appendTo('#container');
});
$(this).next().animate({
left: '50%'
}, 500);
});
它工作得很好,但导航是一个方向,通过点击框激活
提前致谢
aor
【问题讨论】:
标签: jquery animation html carousel slide