使用Java脚本移动div(键盘上的各种值) [英] Moving a div with Java Script(various values from keyboard)
问题描述
你好.
我在HTML页面中有四个Div,并具有一个带字段的公式:位置,顶部,底部,左侧,右侧. 位置"是一个选择框,其中包含:绝对,相对,固定,静态.其他字段必须使用从键盘输入的值来完成.我还有一个按钮"Move it".当我选择一个div时,用一些值完成公式编辑器并按下按钮``移动它'',我选择的div必须在这些值之后移动.
我知道如何使用一些预定义的值移动div,但是以我提到的方式我不知道..有什么想法吗?
谢谢
Hello.
I have four Divs in a HTML page and a formular with fields : position, top, bottom, left, right. ''Position'' is a select box with: absolute, relative, fixed, static. The other fields must be completed with values entered from the keyboard. I have also a button ''Move it''. When i select a div, complete the formular with some values and press the button ;Move it'', my selected div has to move after those values.
I know how to move a div with some predefined values, but in the way I mentioned up i don''t know.. Any ideas?
thanks
推荐答案
以下是使用jQuery的解决方案:
分别> http://stackoverflow. com/questions/4404852/how-use-keyboard-arrow-keys-to-move-a-div-100px-left-right-分别 [
Here is on solution using jQuery:
http://stackoverflow.com/questions/4404852/how-use-keyboard-arrow-keys-to-move-a-div-100px-left-right-respectively[^]
Regards
Espen Harlinn
这篇关于使用Java脚本移动div(键盘上的各种值)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!