#1 設定圖片顯示位置 - 蛙 (Administrator) 發表於 17-5-2012 10:24
<P><FONT color=#0000ff size=3>如不能顯示語法效果可貼去本站</FONT><A href="http://www.bunbun000.com/html/index.htm" target=_blank><FONT color=red size=3>語法測試板</FONT></A><FONT color=#0000ff size=3>試看</FONT></P><P> </P>
<P> </P>
<P><A href="http://bunbun000.com/home/index/BBS.gif"><FONT color=purple>http://bunbun000.com/home/index/BBS.gif</FONT></A><FONT color=purple> <<<圖片網址</FONT></P>
<P><FONT color=#800080></FONT> </P>
<P><A href="http://bunbun000.com/home/index/BBS.gif"><FONT color=purple>http://bunbun000.com/</FONT></A><FONT color=purple> <<<圖片連結位置</FONT></P>
<P><FONT color=purple></FONT> </P>
<P><FONT color=purple> alt="笨笨網站" <<<指著圖片時顯示語句</FONT></P>
<P><FONT color=purple></FONT> </P>
<P><FONT color=purple>var dx=88,dy=31; <<<圖片實際大小</FONT></P>
<P><FONT color=purple></FONT> </P>
<P><FONT color=purple>var choose=4; <<<< 4為圖片出現之位置</FONT></P>
<P><FONT color=purple></FONT> </P>
<P><FONT color=purple>1 顯示在右上角<BR>2 顯示在左上角<BR>3 顯示在左下角<BR>4 顯示在右下角</FONT><BR></P>
<P><FONT color=blue></FONT> </P>
<P><FONT color=blue></FONT> </P>
<P><FONT color=blue></FONT> </P>
<P><FONT color=blue></FONT> </P>
<P><FONT color=blue><div id="mark" style="POSITION: absolute; VISIBILITY: visible ; Z-INDEX: 2000; top: -500px; left:0px;"><BR><A href="</FONT><A href="http://bunbun000.com/home/index/BBS.gif"><FONT color=blue>http://bunbun000.com/</FONT></A><FONT color=blue>" target="_blank"><BR><IMG img border="0" src="</FONT><A href="http://bunbun000.com/home/index/BBS.gif"><FONT color=blue>http://bunbun000.com/home/index/BBS.gif</FONT></A><FONT color=blue>" alt="笨笨網站"></A><BR></div></FONT></P>
<P><BR><FONT color=blue><script language="javascript1.2"></FONT></P>
<P><FONT color=blue>var dx=88,dy=31;<BR>var choose=4;</FONT></P>
<P><FONT color=blue>var bWidth,bHeight,offsetX,offsetY;<BR>var layerRef="null",layerStyleRef="null",styleSwitch="null";</FONT></P>
<P><FONT color=blue>if (document.layers) {<BR> layerStyleRef="layer.";<BR> layerRef="document.layers";<BR> styleSwitch="";<BR> pxSwitch="";</FONT></P>
<P><FONT color=blue> bHeight=window.innerHeight;<BR> bWidth= window.innerWidth;<BR> offsetX= "window.pageXOffset";<BR> offsetY=" window.pageYOffset";<BR>}<BR>else{<BR> layerStyleRef="layer.style.";<BR> layerRef="document.all";<BR> styleSwitch=".style";</FONT></P>
<P><FONT color=blue> bHeight=document.body.clientHeight;<BR> bWidth= document.body.clientWidth;<BR> offsetX= "document.body.scrollLeft";<BR> offsetY= "document.body.scrollTop";<BR>}</FONT></P>
<P><FONT color=blue>function moveLayerto(layerName,top,left){<BR> eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.top=top');<BR> eval(layerRef+'["'+layerName+'"]'+styleSwitch+'.left=left');<BR>}</FONT></P>
<P><FONT color=blue>function alwaysONup(){<BR> var newY;<BR> if(choose == 1) {<BR> layer_y = 0;<BR> layer_x = bWidth;<BR> layer_x += -dx;<BR> }<BR> else if(choose == 2) {<BR> layer_y = 0;<BR> layer_x = 0;<BR> }<BR> else if(choose == 3) {<BR> layer_y = bHeight;<BR> layer_y += -dy;<BR> layer_x = 0;<BR> }<BR> else if(choose == 4) {<BR> layer_y = bHeight;<BR> layer_y += -dy;<BR> layer_x = bWidth;<BR> layer_x += -dx;<BR> }<BR> else {<BR> alert("所輸入不正確!"<BR> }<BR> eval('layer_y+='+offsetY);<BR> moveLayerto("mark",layer_y,layer_x);<BR> setInterval('alwaysONup()');<BR>}</FONT></P>
<P><FONT color=blue>window.onLoad=alwaysONup();</FONT></P>
<P><FONT color=blue></script></FONT></P>