我正在尝试向右滑动但不工作,当我尝试写“右”或“左”而不是“切换”时。它不工作。请帮助我我的代码如下。
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('ul').hide();
});
function next(){
$('ul').animate({width: 'toggle'}, 1000);
}
</script>
<style>
ul{height:30px; overflow: hidden; }
ul li{ display: inline-block; padding: 10px; }
</style>
</head>
<body><p onclick="next()">next</p>
<ul>
<li>1</li>
<li>2</li>
<li>3</li>
<li>4</li>
<li>5</li>
<li>6</li>
</ul>
</body>
</html>