Hi.
Thanks for your reply but that's not the way to do it as far as I know.
Look at the script down below, this is working but only if the link is not an URL.
If the link points to an image it is working but not if the link points to an URL.
So I think if one of the guys who is advanced in javascript coding could help out with a modification to this script would make it work.
If the link points to an URL the window opens and also closes if clicked somewhere but the window that pops up has no content in it.
That is why I think it is probably just a small thing that has to be changed.
Thanks again
Not working link:
Code:
<p align="center"><a href="http://www.mysite.com"onclick="NewWindow(this.href,'popup','350','175','no','center');return false" onFocus="this.blur()"/a>popup</a>
Working link:
Code:
<p align="center"><a href="http://www.mysite.com/popup.jpg"onclick="NewWindow(this.href,'popup','350','175','no','center');return false" onFocus="this.blur()"/a>popup</a>
Code:
var win=null;
function NewWindow(mypage,myname,w,h,scroll,pos){
if(pos=="random"){LeftPosition=(screen.width)?Math.floor(Math.random()*(screen.width-w)):100;TopPosition=(screen.height)?Math.floor(Math.random()*((screen.height-h)-75)):100;}
if(pos=="center"){LeftPosition=(screen.width)?(screen.width-w)/2:100;TopPosition=(screen.height)?(screen.height-h)/2:100;}
else if((pos!="center" && pos!="random") || pos==null){LeftPosition=0;TopPosition=20}
settings='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',location=no,directories=no,status=no,menubar=no,toolbar=no,re sizable=no';
win=window.open('',myname,settings);
win.document.write('<body style="margin:0;padding:0;" onblur="self.close()"><img src="'+mypage+'">');
win.document.close();
}
Bookmarks