kbrimgordon
06-30-2006, 05:58 AM
Hello, I've put three peices of code together, and amazingly, it is working!!! (I'm NOT a techie, and javascript is a new animal for me.) I have a gallery page, with thumbnails on the left, which have mouseovers that show a large picture on the right that changes with the mouseover. Now my client informs me she wants people to be able to click on the thumbnails so a static picture will open that they can rightclick/save. So I have that working, but the window pops up on the top/left side of the screen. Is there any way I can get it to open on the top/right side instead? I've tried changing a few things, but it didn't work so I changed it all back. The page I'm working on is at:
http://www.sherrypetta.com/theGALLERYtestlinks.html
Here is the code:
This is the part of the script in the head that pertains to opening the popup (note that I tried changing the two places it says 'myleft' to 'myright', but it didn't work):
<!--
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";win=window.open(mypage,myname,settings);
win.focus();}
// -->
Here is the code in my body - note that I've built this href from several different peices of javascript that I merged together, so there is more script in the head that pertains to parts of it than what I pasted above... I have set the part that pertains to the popup in bold below; and I am just pasting what pertains to one thumbnail/button rather than all thirteen of them:
<a href=
"javascript:NewWindow('http://www.sherrypetta.com/images/Flip_1lg.jpg','acepopup','375','400','custom','front');"
onMouseOver="hiLite('pic','pic2','a','a2'); window.status='Button 1';return true;" onMouseOut="hiLite('pic','pic1','a','a1'); window.status='';return true;" onclick="window.focus()"><img SRC="images/Flip_1.jpg" NAME="a" ALT="Button 1" BORDER=0 height=54 width=54></a>
OK, hope that makes sense. Hope someone can help!
kbrimgordon
http://www.sherrypetta.com/theGALLERYtestlinks.html
Here is the code:
This is the part of the script in the head that pertains to opening the popup (note that I tried changing the two places it says 'myleft' to 'myright', but it didn't work):
<!--
var win=null;
function NewWindow(mypage,myname,w,h,pos,infocus){
if(pos=="random"){myleft=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;mytop=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){myleft=(screen.width)?(screen.width-w)/2:100;mytop=(screen.height)?(screen.height-h)/2:100;}
else if((pos!='center' && pos!="random") || pos==null){myleft=0;mytop=20}
settings="width=" + w + ",height=" + h + ",top=" + mytop + ",left=" + myleft + ",scrollbars=yes,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=yes";win=window.open(mypage,myname,settings);
win.focus();}
// -->
Here is the code in my body - note that I've built this href from several different peices of javascript that I merged together, so there is more script in the head that pertains to parts of it than what I pasted above... I have set the part that pertains to the popup in bold below; and I am just pasting what pertains to one thumbnail/button rather than all thirteen of them:
<a href=
"javascript:NewWindow('http://www.sherrypetta.com/images/Flip_1lg.jpg','acepopup','375','400','custom','front');"
onMouseOver="hiLite('pic','pic2','a','a2'); window.status='Button 1';return true;" onMouseOut="hiLite('pic','pic1','a','a1'); window.status='';return true;" onclick="window.focus()"><img SRC="images/Flip_1.jpg" NAME="a" ALT="Button 1" BORDER=0 height=54 width=54></a>
OK, hope that makes sense. Hope someone can help!
kbrimgordon