Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open the same window for different images?

Status
Not open for further replies.

vitf

Technical User
Nov 1, 2000
2
CA
In my pages I have a lot of thumbnail images. When a visitor clicks on a thumbnail to get a bigger picture, I want each picture to be opened in the same window. This window is already prepared and has an advertisement, which should be displayed along with the picture. Can somebody help me with the script? Thanks a lot.
 
Frames might be a better bet for this task, but here you go...
Code:
<html>
<script language = &quot;javascript&quot;>
function fnPicture(picName){
 var winVars = &quot;top=0,left=0,width=640,height=400&quot;
 var winOpen = window.open(picName,&quot;picWindow&quot;,winVars)
}

</script>
<body>
 <input type=button value=&quot;Image 1&quot; onClick=&quot;fnPicture('image1.jpg')&quot;>
 <input type=button value=&quot;Image 1&quot; onClick=&quot;fnPicture('image2.jpg')&quot;>
</body>
</html>

Later, Rob
robschultz@yahoo.com
-Focus on the solution to the problem, not the obstacles in the way.-
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top