我发现下面的代码在多个地方滑动左/右:
$('#hello').hide('slide',{direction: 'left'},1000);
但是,我不能得到它的工作。这里是我试图的简化测试:
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en-us">
<head>
<script src="http://code.jquery.com/jquery-latest.js"></script>
<script>
$(document).ready(function() {
$("#test").click(function() {
$('#hello').hide('slide',1000);
});
});
</script>
</head>
<body>
<article >
<div id="hello">
Hello
</div>
<p><span id="test">Test</span>
</arcticle>
</body>
我试过它在Chrome和Safari和它不工作。
问题是什么?有没有其他工作方法左/右滑动?
解决方法
$(‘#hello’)。hide(‘slide’,{direction:’left’},1000);需要jQuery-ui库。见
http://www.jqueryui.com