homepage Welcome to WebmasterWorld Guest from 184.72.82.126
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

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




msg:1493008
 6:33 pm on Jul 30, 2003 (gmt 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

 

Sinner_G




msg:1493009
 6:46 pm on Jul 30, 2003 (gmt 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>

midi25




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

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

Sinner_G




msg:1493011
 6:33 pm on Jul 31, 2003 (gmt 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)

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved