Just wondered if anyone could tell me how this effect is achieved, when an image is clicked on it loads up in a new window that is just above the main page? Is it Javascript that is used, and if it is, could someone direct me to the website where i can get the script?
hi MarGera332 using following function you can open a image in new window call it on click even of anyimage like onclick=myPopup2(file-path-to-open); function myPopup2(filePathToOpen) { window.open( filePathToOpen, "myWindow", "status = 1, height = 300, width = 300, resizable = 0" ) }
Take a look at the source... You will see that this clever designer is making heavy use of script libraries. Not, incidentally, opening new windows (which is a bit naff). I'm afraid there is a steep learning curve for this stuff.
You could try something less ambitious by either changing the src of an existing ID'd image... document.getElementById("yourid").src="filename.jpg" Or... set the contents of a div using innerHTML... document.getElementById("divID").innerHTML="<img src='filename.jpg' width='xxx' height='yyy' />"
You can address and change the dimensions of a div (or other elements)... document.getElementById("divID").style.width=xx+"px" ... etc (note the use of the style attribute here, this can be rolled into a variable reference) Or an image... document.getElementById("yourid").width=xx+"px" (but here width is an HTML attribute of images, strangely, this attribute can't be rolled into a variable)