CSS定位奇怪问题,大家帮解决下
读取一个时正常,读取二个,第二个的DIV会和第一个重叠,只能看到一个,读取三个,又会显示二个,意思就是二个数据重叠一个位置,有时间的朋友最好把下面二个文件保存起来运行下,就知道我的意思,为这个事烦透了
1.asp
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>测试</title>
</head>
<body>
<STYLE>
#content {
width: 100%;
margin-right: auto;
margin-left: auto;
text-align: center;
}
.xml_show{
width: 758px;
height: 300px;
margin-bottom: 8px;
text-align: left;
font-size: 12px;
}
.txm_show{
width: 252px;
float: left;
margin-bottom: 72px;
}
</STYLE>
<script>
function txm_sc(txm_code,divi) {
if(window.XMLHttpRequest){
ajax=new XMLHttpRequest();
}
else if(window.ActiveXObject)
{
ajax=new ActiveXObject("Microsoft.XMLHTTP");
}
var strurl="txm_code="+txm_code;
ajax.open ("POST","txm.asp",false);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");//
ajax.send (strurl);
var Html=ajax.responseText;
var divi="txm_show_"+divi;
document.getElementById(divi).innerHTML=unescape(Html);
}
</script>
<%
html="<div align=""center""><div class=""xml_show"">"
for i=1 to 9
html=html&"<div class=""txm_show"" id=txm_show_"&i&"><img src=images/load.gif border=0><SCRIPT LANGUAGE=""JavaScript"">txm_sc('8003424432435','"&i&"');</script></div>"
i=i+1
next
response.write html&"</div></div>"
%>
</body>
</html>
txm.asp
<%
Response.Charset="GB2312"
ean13(request("txm_code"),2,20)
Function ean13(code,w,h)
Dim Guide,Dict,Lencode,Rencode,cStart,cMid,cEnd,Barcode,Lmethod
Guide = array("AAAAAA","AABABB","AABBAB","ABAABB","ABBAAB","ABBBAA","ABABAB","ABABBA","ABBABA")
Set Dict = CreateObject("Scripting.Dictionary")
Dict.Add "A", "0001101001100100100110111101010001101100010101111011101101101110001011"
Dict.Add "B", "0100111011001100110110100001001110101110010000101001000100010010010111"
Rencode = array("1110010","1100110","1101100","1000010","1011100","1001110","1010000","1000100","1001000","1110100")
cStart="101"
cMid="01010"
cEnd="101"
if w<2 then w=2
if h<20 then h=20
cWidth=w '条码单元宽度
cHeight=h '条码高度
'检验条码是否符合标准
if len(code)<>13 then response.write "必须为13位!":response.end
for i=1 to 12
if IsNumeric(mid(code,i,1)) then
if i mod 2 then
rsum=rsum+int(mid(code,i,1))
else
lsum=lsum+int(mid(code,i,1))
end if
else
response.write "必须为数字码!":response.end
end if
next
if 10-((lsum*3+rsum) mod 10) <> int(right(code,1)) then response.write "此条码错误!":response.end
'转换条码
Barcode=cStart
Lmethod=left(code,1)
'if Lmethod=0 then Lmethod=1
for i=2 to 7
barcode = barcode & mid(Dict(Mid(Guide(Lmethod-1),i-1,1)),(7*mid(code,i,1)+1),7)
next
barcode=barcode & cMid
for i=8 to 13
barcode = barcode & Rencode(mid(code,i,1))
next
barcode=barcode & cEnd
fg="#000000" '条码前景色
bg="#ffffff" '条码背景色
response.write "<div style='position:absolute;width:"&cWidth*95+60&"px; height:"&cHeight+30&"px; background:"&bg&";'>"
'绘制条码
for x=1 to len(barcode)
if x<5 or x>92 or (x>46 and x<51)then
sh=10
else
sh=0
end if
if mid(barcode,x,1)="1" then
bColor=fg
else
bColor=bg
end if
response.write "<div style='position:absolute;left:"&(x-1)*cWidth+30&"px;top:5px;width:"&cWidth&"px;height:"&cHeight+5+sh&"px;background:"&bColor&";'></div>"
next
'加入可读数字标签
response.write "<div style='position:absolute;left:16px;top:"&cHeight+10&"px;background:"&bg&";color:"&fg&";font:12px Verdana;'>"&left(code,1)&"</div>"
for x=1 to 6
response.write "<div style='position:absolute;left:"&(x*7+2)*cWidth+22&"px;top:"&cHeight+10&"px;background:"&bg&";color:"&fg&";font:12px Verdana;'>"&mid(code,x+1,1)&"</div>"
response.write "<div style='position:absolute;left:"&(x*7+47)*cWidth+24&"px;top:"&cHeight+10&"px;background:"&bg&";color:"&fg&";font:12px Verdana;'>"&mid(code,x+7,1)&"</div>"
next
response.write "</div>"
End Function
%>