Welcome to WebmasterWorld Guest from 54.159.12.17

Forum Moderators: open

Message Too Old, No Replies

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

     

midi25

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

10+ Year Member



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

Sinner_G

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

WebmasterWorld Senior Member 10+ Year Member



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>

midi25

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

10+ Year Member



thanks I will give it a try and let you know how i got on.

Sinner_G

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

WebmasterWorld Senior Member 10+ Year Member



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)

 

Featured Threads

Hot Threads This Week

Hot Threads This Month