使用jquery设置di​​v位置 [英] set the div position using jquery

查看:55
本文介绍了使用jquery设置di​​v位置的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友

i页面中有div,divid,top,left,height,width值存储在database.if我从数据库中获取值,值得到但是使用jquery不能修复div。 使用jquery从数据库动态设置div位置。我是新手。任何身体帮助我。谢谢。

解决方案





看到最简单的方法创建div可能如下所示:



函数createDiv(obj1,obj2,obj3,obj4){
< span class =code-keyword> var newDiv = ' < div id =test1style =height:' + obj1 + ' ; width:' + obj2 + ' ; color:' + obj3 + ' ;> rakesh< / div>'


' #OBJ4' )追加(newDiv)。


}







这里我通过了四个高度,宽度,颜色和另一个div或页面ID的参数,我必须添加这个新创建的div。



i希望它可能会有所帮助。


HI,



您可以使用以下内容:



 

hi friends
i have a div in the page and divid,top,left,height,width values are stored in database.if i am getting the values from data base, the values are get but the div not to be fix using jquery. dynamically set the div position from database using jquery. i am newbie this. any body help me.thanks a lot.

解决方案

Hi,

see the best and simple method to create a div might be like below:

      function createDiv(obj1, obj2, obj3, obj4) {
           var newDiv = '<div id="test1" style="height:'+obj1+';width:'+obj2+';color:'+obj3+';">rakesh</div>'


('#obj4').append(newDiv); }




here i have passed the four paremeters which are height,width,color and another div or page id where i have to add this newly created div.

i hope it might help.


HI,

You can use some thing like :


这篇关于使用jquery设置di​​v位置的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆