1
A
回答
0
你是指向右滑動的元素?您可以使用animate
方法。並列浮動div元素,其中左側元素的初始寬度爲零。要顯示一個框,您可以使用元素爲其設置動畫,然後顯示其中的內容。
實施例:
<style type="text/css">
.slideBox { float: left; margin: 2px; width: 0; height: 200px; background: #eee; }
.slideBox .content { display: none; margin: 10px; background: #ccc; }
#first { width: 100px; }
#first .content { display: block; }
</style>
<script type="text/javascript">
$(function(){
$('#first').click(function(){
$('#second').animate(
{ width: '100px' },
{complete:function(){ $('#second .content').css('display','block'); }}
);
});
$('#second').click(function(){
$('#third').animate(
{ width: '100px' },
{complete:function(){ $('#third .content').css('display','block'); }}
);
});
$('#third').click(function(){
$('#fourth').animate(
{ width: '100px' },
{complete:function(){ $('#fourth .content').css('display','block'); }}
);
});
});
</script>
<div class="slideBox" id="fourth"><div class="content">fourth</div></div>
<div class="slideBox" id="third"><div class="content">third</div></div>
<div class="slideBox" id="second"><div class="content">second</div></div>
<div class="slideBox" id="first"><div class="content">first</div></div>
相關問題
- 1. JQuery克隆插入後
- 2. jquery insertAfter()也插入克隆
- 3. 克隆並插入jQuery
- 4. jQuery的克隆不克隆
- 5. jQuery克隆和select2事件
- 6. Jquery UI:克隆小部件
- 7. jQuery克隆|
- 8. jquery克隆和
- 9. Web2py jQuery克隆
- 10. Jquery克隆類
- 11. 克隆()jQuery中
- 12. Jquery克隆問題與克隆表格
- 13. Jquery的克隆()修改後克隆
- 14. jQuery克隆 - 產生的克隆控件不起作用
- 15. jQuery克隆:它應該克隆DOM級別0事件嗎?
- 16. jQuery的克隆()不克隆事件綁定,即使與on()
- 17. 克隆的Jquery timePicker
- 18. jQuery克隆錶行
- 19. JQuery循環克隆
- 20. jQuery刪除/克隆
- 21. jQuery克隆問題
- 22. jQuery的HTML(),克隆
- 23. 克隆jquery浮圖
- 24. jQuery手機克隆
- 25. jQuery克隆驗證
- 26. 當克隆jQuery中
- 27. jquery克隆兒童
- 28. jquery格式克隆
- 29. jquery克隆/拖動
- 30. GIT Jenkins插件克隆而不是拉
有道理。我立即把它想象成動態的,並根據需要創建盒子。 – 2010-02-18 12:57:07