Welcome to WebmasterWorld Guest from 54.196.35.120

Forum Moderators: open

Message Too Old, No Replies

How can I get a small window to open when a link is clicked

     
6:33 pm on Jul 30, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 30, 2002
posts:198
votes: 0


Hi i,m developing a site and I want a small sized window to open when a user clicks on a link.

The window will contain information that i want to display.It dosnt require a normal 800x600 window to open. I just want a 1/4 size of 800x600 etc. Is this possible and if so how.

I havnt done this before

Thanks

6:46 pm on July 30, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 27, 2002
posts:959
votes: 0


What you need is a JavaScript function to open the window:

<script type="text/javascript">
function wopen(url,popupname,attributes){
win = window.open(url,popupname,attributes);
win.focus();
}

Place the above into the <head> of your document. The link then should look like this:

<a href="#" onMouseUp="wopen('popup.html','popupname','width=400,height=300');">link</a>

10:47 pm on July 30, 2003 (gmt 0)

Junior Member

10+ Year Member

joined:Apr 30, 2002
posts:198
votes: 0


thanks I will give it a try and let you know how i got on.
6:33 pm on July 31, 2003 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:June 27, 2002
posts:959
votes: 0


Can't edit my previous msg any more, so here is the complete script that should go into the <head> (including the </script> now):

<script type="text/javascript">
function wopen(url,popupname,attributes){
win = window.open(url,popupname,attributes);
win.focus();
}
</script>

Stupid (aka Sinner)