我的水平滚动有问题。当我用铬进行检查时,我没有看到错误。你能告诉我问题在哪里,因为我找不到它?水平滚动jquery
<html>
<head>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.0/jquery.min.js" type="text/javascript"></script>
<script>
$('#right-button').click(function() {
$('#content').animate({
marginRight: marginRight -"200px"
}, "fast");
});
$('#left-button').click(function() {
$('#content').animate({
marginLeft: marginLeft +"200px"
}, "fast");
});
</script>
<style type="text/css">
#browser {
float: left;
width: 300px;
overflow: hidden;
white-space: nowrap;
}
</style>
</head>
<body>
<div id="browser">
<a href="#" id="left-button">BACK</a>
<div id="content">
This is the content of the text which should be scrolled.
</div>
<a href="#" id="right-button">NEXT</a>
</div>
</body>
改变,但仍然无法正常工作 – user1107922
还有一个(逻辑)的问题。看[示范](http://jsfiddle.net/9hubz/)。 –
谢谢!有用! – user1107922