Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/javascript/432.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 动态元素的绝对中心_Javascript_Jquery_Html_Css - Fatal编程技术网

Javascript 动态元素的绝对中心

Javascript 动态元素的绝对中心,javascript,jquery,html,css,Javascript,Jquery,Html,Css,所以我有一个旋转器,它工作得很好。但是,主框由最大的图像决定。所有的图像(如果更小的话)都应该漂浮在主框的中心。然而,我的边距编辑似乎在代码中没有任何作用。你知道他们为什么不申请吗 var postimgrotator=$('.postimgrotator'), 预加载程序=$(“#加载图像”); PostMgrotator.each(函数(){ 这个['tmp']=''; this.tmp2=''; this.positmages=新数组(); this.cur=0; 此值为0.count;

所以我有一个旋转器,它工作得很好。但是,主框由最大的图像决定。所有的图像(如果更小的话)都应该漂浮在主框的中心。然而,我的边距编辑似乎在代码中没有任何作用。你知道他们为什么不申请吗

var postimgrotator=$('.postimgrotator'),
预加载程序=$(“#加载图像”);
PostMgrotator.each(函数(){
这个['tmp']='';
this.tmp2='';
this.positmages=新数组();
this.cur=0;
此值为0.count;
log($(this));
this['positmages']=$(this.html().trim().split(“”);
此['count']=此['postimages'].长度;
$(this.html(“”);
for(this['cur']=0;this['cur']
#加载图像{
位置:绝对位置;
排名:0;
左:-9999px;
}
邮递员{
位置:相对位置;
背景色:rgba(0,0,0,0.5);
填充:10px;
边界半径:10px;
-moz边界半径:10px;
-webkit边界半径:10px;
文本对齐:居中;
利润率:10px;
}
.邮递经理{
位置:绝对位置;
最高:50%;
左:50%;
}

http://i1291.photobucket.com/albums/b551/ToxicBKFX/Abstractweek2_zps25dbb861.png http://s28.postimg.org/xkim4q9xp/Aliens_Movie.png http://i.imgur.com/l2SQ4qW.png
http://i1291.photobucket.com/albums/b551/ToxicBKFX/Abstractweek2_zps25dbb861.png http://s28.postimg.org/xkim4q9xp/Aliens_Movie.png http://i.imgur.com/l2SQ4qW.png
这有帮助吗

var postimgrotator=$('.postimgrotator'),
预加载程序=$(“#加载图像”);
PostMgrotator.each(函数(){
这个['tmp']='';
this.tmp2='';
this.positmages=新数组();
this.cur=0;
此值为0.count;
log($(this));
this['positmages']=$(this.html().trim().split(“”);
此['count']=此['postimages'].长度;
$(this.html(“”);
for(this['cur']=0;this['cur']
#加载图像{
位置:绝对位置;
排名:0;
左:-9999px;
}
邮递员{
位置:相对位置;
背景色:rgba(0,0,0,0.5);
填充:10px;
边界半径:10px;
-moz边界半径:10px;
-webkit边界半径:10px;
文本对齐:居中;
利润率:10px;
}
.邮递经理{
位置:绝对位置;