一开始使用$("").css(“margin-left",num--)
但是这种方法经常会有一种卡顿的感觉,遂优化
使用jquery.scrollLeft优化后:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<script src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.0.js"></script>
<style type="text/css">
.info_swiper{
font-size: 16px;
color: #d6503d;
text-align: center;
height: 20px;
text-align: center;
}
.info_swiper>div{
width: 300px;
height: 20px;
line-height: 20px;
overflow: hidden;
white-space: nowrap;
margin:0 auto;
}
.info_swiper a{
color: #42ccf3;
display: inline-block;
}
</style>
</head>
<body>
<div clas