var adWidth = $(".content_right .ad").width()
$(".slider").stop(true,false).animate({left : -adWidth*index},1000)
$(".num li").removeClass("on")
.eq(index).addClass("on")
}
当然你也要调整样式的
<script>var show = 0
function leftRun(){
show-=100
document.getElementById("b").style.marginLeft = show+"px"
}
function leftRun(){
show+=100
document.getElementById("b").style.marginRight= show+"px"
}
</script>
<div id="a" width="500">
<div id="b" width="1000">
正文内容
</div>
</div>
<input type="button" id="leftRun" onclick="leftRun()" />
<input type="button" id="rightRun" onclick="rightRun()" />