我有一个代码假设将 a<div>
从 94% 向左移动到大约 4%,但它似乎不起作用。我相信缺陷在于代码的 CSS 部分,因为控制台不会报告任何错误。
HTML:
<body id="page_body">
<div class="header_wrap">
<div class="header_main_title">
<h1>Text</h1>
</div>
</div>
<div id="scroll" class="scroll_button"></div>
<div class="container">
<div class="leftslide"></div>
<div class="rightslide"></div>
</div>
</body>
CSS:
div.container {
/*width: 2960px;*/
width: 1600px;
height: 710px;
}
div.leftslide {
float: left;
width: 1500px;
background: url("1.jpg");
background-repeat: no-repeat;
height: 790px;
}
div.rightslide {
position: fixed;
left: 94%;
width: 1460px;
background: url("1.jpg");
background-repeat: no-repeat;
height: 790px;
}
JS:
$('#scroll').click(function() {
$('.rightslide').animate({left: "100%"});
});
JSFIDDLE:http: //jsfiddle.net/AFysR/