Simple point to text display content instance
| The code is as follows |
Copy Code |
| <meta http-equiv= "Content-type" content= "text/html; charset=gb2312 "/> <title>oec2003</title> <script language= "JavaScript" type= "Text/javascript" > <!-- function Toggle (Targetid) { if (document.getElementById) { Target=document.getelementbyid (Targetid); if (target.style.display== "block") { Target.style.display= "None"; } else { target.style.display= "Block"; } } } --> </script> <style type= "Text/css" > <!-- #div1 { Background-color: #000000; height:400px; width:400px; Display:none; } --> </style> <body> <input type= "button" id= "Butn" value= "Show/Hide" onclick= "toggle (' Div1 ')"/> <center> <div id= "Div1" ></div></center> Centered Div </body>
|
Show pictures when connected
| The code is as follows |
Copy Code |
| <! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" "Http://www.w3.org/TR/html4/loose.dtd" > <title></title> <script type= "Text/javascript" > var path = './'; Picture relative path function Show (obj) { var name = Obj.innertext; var sdiv = document.getElementById (' img_ ' + name.split ('. ') [0]); /File name Oneself judge if (!sdiv) { Sdiv = document.createelement ("DIV"); sdiv.id = ' Img_ ' + name.split ('. ') [0]; sDiv.style.position = ' absolute '; SDiv.style.top = obj.offsettop + obj.offsetwidth + ' px '; SDiv.style.left = obj.offsetleft +obj.offsetheight + ' px '; SDiv.style.border = ' 1px red solid '; var img = document.createelement ("img"); IMG.SRC = path + name; Sdiv.appendchild (IMG); Document.body.appendChild (SDIV); } SDiv.style.display = ' block '; } function f (obj) { var name = Obj.innertext; var sdiv = document.getElementById (' img_ ' + name.split ('. ') [0]); /File name Oneself judge if (sdiv) { SDiv.style.display = ' None '; } } </script> <body> <div onmouseover= "Show (This)" onmouseout= "F (This)" style= "Position:absolute;" > Wait.gif </div> </body> |