jQuery动态修改DIV位置

jQuery动态修改DIV位置
我用下面这个
可是总是不对
设置不上
难道不能这么设?
求教
====
var temp=100
$(“#div01”).css("left",temp);
$(“#div01”).css("top",temp);
====
$(“#div01”).css({position: "absolute"});
我写了
而且
如果用
$(“#div01”).css("left",100);
$(“#div01”).css("top",100);
就好用

该怎么使用变量的值呢?

修改div的位置,其实就是修改div的left和袜衡top值。

思路:

  1. 先选出div这个对象。

  2. 修改div的left和top值。

下面是代码:


    
    
大老
    
    
你好,你的#div01有加 position:absolute;这个样式么,没有的话加上看下,没有浮动起来,加top和left没用的哦。

你应该把加position的放到前面去。渗燃贺在JQ修丛派改TOP和LEFT的前面去。
var temp=100

$(“#div01”).css({position: "absolute"});

$(“#div01”).css("left",temp);
$(“#div01”).css("top",temp);

希望我的回答对你段毁有帮助。
var temp=100;
$("#div01"侍盯码).css("position"则旅,"fixed");
$("#div01").css("left",temp);
$("老哪#div01").css("top",temp);
//历李在div class="bianse " 的下面加一空滚个div标签
$(".bianse").after("

jjjjjjjjjjjjjjjjjjjj

"斗烂余);
我直接复制你的代码没有问题。