Q
水平移动div?
0
A
回答
0
您可以使用jQuery和slideDown()
和slideUp()
函数。见http://api.jquery.com/category/effects/sliding/
3
您有权设置位置=绝对的,然后设置x和y的股利。您可以在javascript中更改它们的x和y。有很多可用的滑动脚本。
1
能这样进行:
// Moving the element to the 200 x 200 coordinate relative to
// the parent element, WITHOUT JQUERY
var elementStyles = document.getElementById("someDiv").style;
elementStyles.position = "absolute";
elementStyles.top = 200 + "px";
elementStyles.left = 200 + "px";
// Moving the element to the 200 x 200 coordinate relative to
// the parent element, WITH JQUERY
$("#someDiv").animate({
top: 200 + "px",
left: 200 + "px"
});
// If the position should be changed relative to the current position,
// add a `"+=" +` in front of `200` in the jQuery script, like this:
left: "+=" + 200 + "px"
相关问题
- 1. 垂直移动水平移动div
- 2. 垂直滚动时水平移动DIV
- 3. UIModalTransitionStyle水平移动
- 4. Drupal/jquery水平滚动div
- 5. 水平滑动div与JQuery
- 6. 水平居中浮动div
- 7. CSS水平DIV滚动
- 8. Div只有水平滚动
- 9. Div水平滚动问题
- 10. 滚动条水平DIV
- 11. div的水平滚动条
- 12. 用Javascript水平移动
- 13. Unity中的水平移动
- 14. 水平移动一个UIView
- 15. jQuery的滚动目标DIV水平移动
- 16. 在滚动div内水平对齐DIV
- 17. DIV水平
- 18. div水平滚动不工作自动
- 19. 滚动水平动态div项目
- 20. 水平并排div div
- 21. 滚动时水平移动元素
- 22. 水平滚动移动步骤
- 23. 移动Safari上的水平滚动
- 24. 动画:水平和垂直移动ImageButton
- 25. 水平定位Div
- 26. 水平中心div
- 27. 中心DIV水平
- 28. 水平对齐div
- 29. 水平导航栏下拉和水平移动
- 30. 水平平移D3.js
把更多的问号的称号!!!!! – fig 2010-04-27 13:05:50
你应该考虑使用jQuery,而不是用普通的javascript编码。特别是如果你想让div移动到新的地方,而不是立即“跳过”那里。 – 2010-04-27 13:06:36