You are on page 1of 1

Background previewer

This JavaScript will load a background image onto a new window and tile it for
previewing.

Insert into <HEAD>

<script>
<!--
/*By George Chiang (WA JavaScript site www.abstract.simplenet.com)
Credit must stay intact for use*/
function tile(bgname){
win2=window.open("","","width=380,height=380")
if (win2){
win2.focus()
win2.document.open()
win2.document.write("<head><title>"+bgname+"</title></head>")
win2.document.write("<body background="+'"'+bgname+'"'+">")
win2.document.write("</body>")
win2.document.close()
}
else
alert("Failed in spawning a new window!")
}
//-->
</script>

Insert into <BODY>


<a href="test.htm"
onclick="tile('backgr10.jpg');return false"><img
src="backgr10.jpg" border="0" width="80"
height="80"></a>
<a href="test.htm"
onclick="tile('backgr11.jpg');return false"><img
src="backgr11.jpg" border="0" width="128"
height="128"></a>

You might also like