为啥JS中一个函数里的层在布局时没有跟着JS中的链接走,就是函数中的函数里的层,可能不好理解,大概就是那个意思吧。

解决方案 »

  1.   

    我给出段代码可能就明白了,就是下面的层<div class="addchatpicture" id="addchatpicture"></div>为啥只在一个位置有,而没有在每行都有?....
    showStr+=' </div>';
    showStr+=' <div class="row02m">'; 
    showStr+=''+cmtInfo[0]+'<br>';
    showStr+='<span class="font1001">'+cmtInfo[2]+'</span>';
    showStr+='<br><br>';
    showStr+=''+cmtInfo[3]+'<br>'; //comment TEXT
    showStr+='<br><br>';
    showStr+='<input type="button" name="chataddpic" id="chataddpic" value="upload picture" onClick="javascript:showPicupLoad();">';
    showStr+='<div class="addchatpicture" id="addchatpicture">';
    showStr+='<FORM name="SCM" action="khimgaddmainpicture.asp" method="post" encType="multipart/form-data">';
    showStr+='<p class="chatmainpicture">Main picture:';
    showStr+='<INPUT type="file"name="file1" ></p>';
    showStr+='<p class="chatmainpicture2">\<input type="submit" name="FMDJ" value="submit"class="xian">';
    showStr+='<input type="reset" name="Submit2" value="reset"class="xian">';
    showStr+='</form>';
    showStr+='</div>';
    showStr+='&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type="text"   name="chatcomment" id="chatcomment" size="50" class="chatcomment" onFocus="javascript:cleantitlevalue();" onBlur="javascript:filltitlevalue();" value="Write comment here">';
    showStr+='&nbsp;&nbsp;<input type="button" name="chatsubcom" id="chatsubcom" class="chatsubcom" value="Comment">';
    //showStr+='<span class="chatterline"></span>';
    showStr+=' </div>';
    //showStr+='</tr>';
    }
    }catch(ci){
    showStr+='<span><br>Something exception happen.</span>';
    }
    showStr+='</table>';
    oUPicList.html(showStr);
    //showStr=null;
    //chatinfo(gbrefUID);
    chatinfoBoxConUI(); 
    }
    .......
      

  2.   

    父层是说哪一个?是说这个<div class="row02m">吗?showStr里面只把<div class="addchatpicture" id="addchatpicture">.....</div>加了一次,为何你会觉得应该“每行”出现一个呢?
      

  3.   

    有没人知道啊?别沉了。就是现在的这个地方:http://www.ladlady.com/asp/chatter.asp
    点upload picture 只在上面一个地方出来,用啥方法才能在下面每张图片下面出来呢?
      

  4.   


    想简单的话,你要每个人(一行)下方,都加上一个DIV并隐藏,点击upload picture后再显示。
    想要代码少些,那就做一个统一的弹出层。
    或者点击upload picture后用JS弄。
      

  5.   

    1.定位坐标设置不准。
    2.想定位的那个层的CLASS样式根本没设为position:absolute(看你问问题问得这么乱套,不能排除有这个可能)。
      

  6.   

    一个div ,设置绝对定位!
    点击时设置div 的位置和对应数据就可以了可以看看 csdn 左边的头像,鼠标移上去的效果
      

  7.   

    我有设置绝对定位,但“点击时设置div 的位置和对应数据就可以了“不知咋弄,也用了JS 但就是定位麻烦,这个效果确实有点像csdn 左边的头像,鼠标移上去的效果
      

  8.   

    将<div class="addchatpicture" id="addchatpicture"></div>设置为绝对定位
    position:absolute;并给该层找一个相对位置(外层元素),并设置它为
    position:relative;
    比如:<div style="float:right; margin-top:6px; margin-right:6px; position:relative">
         <div class="addchatpicture" id="addchatpicture" style="position:absolute; left:-128px; top: -92px; z-index:100">
    </div>
      

  9.   

    没问题,照上面做了,确实每行都有了绝对定位层,但我下面的代码只能隐藏和显现第一行的这个层,有啥办法能改下面的代码呢?id 都是一样的:addchatpicture 所以都只对第一层起作用啊。
    function showPicupLoad(){
    var oPictureCon=getObj('addchatpicture');
    //alert(oPictureCon);
     if(oPictureCon.style.display!="block"){
    oPictureCon.style.display="block"
    }
    else{
    if(oPictureCon.style.display=="block"){
    oPictureCon.style.display="none"
    }
      }