Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Need a little help guys, Basic Javascript
Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
tlivingston




PostPosted: Tue Jan 20, 2004 4:43 pm   Post subject: Need a little help guys, Basic Javascript

So basically i want it so when you click a link, the page opens up a new window of a set resolution/size (aka 300 x 400 or whatever) that has a brief description or picture. I also want it so the window opened has no navigation bar or anything, just the actual window, and has a "click here to close" at the bottom which closes the window. If anyone can put in some sample code that would be awesome. Thanks so much guys,

Ted

PS I'm trying to start a company which builds custom computers. The window is for like a click here for bigger picture (aka, the window would be just big enough for the pic). The site is here and I would really appreciate any input on the site as well. If you were in the market for a computer would there be anything holding you back from buying a custom pc? If so what? Thanks so much again.
Sponsor
Sponsor
Sponsor
sponsor
Draemus




PostPosted: Fri Feb 06, 2004 3:27 pm   Post subject: (No subject)

code:
<a href="#" onClick="window.open('filename.html','image','height=400, width=300, scrollbars'); return false;">


For your own understanding...

The '<a href="#" ' part tells the browser to stay on the current page, instead of loading the page you want to open in the pop-up window.

The second part is what calls the popup. The stuff in the brackets are the parameters, and work as follows:

'filename.html' - This is the page that will be loaded into the pop-up. If you're loading an image, you'll probably have something like 'images/filename.jpg' or something. Works just like regular links.

'image' - This is the name of the window. So for example, if you had 3 different thumbnails on a site and each linked using the code above, then since they all have 'image' as the name of the window, when you click the thumbnail, the full-size picture will load in the same window. To have it open in a different window, simply change the name to something else.

height=400 - Self-explanatory. This is the height (in pixels) of the window

width=300 - Self-explanatory. This is the width (in pixels) of the window.

scrollbars - This tells the browser what to include on the new window. In this case, only scrollbars will be shown. If you were to use nothing for this field, you'd get just a basic window with a title bar. You can also add other parameters such as resizeable, etc. http://www.webmonkey.com has more on it.

return false - This tells the browser not to re-load the main page, and to just open the pop-up instead.

And that's all.
Catalyst




PostPosted: Fri Feb 06, 2004 11:48 pm   Post subject: (No subject)

a tip for the site: dont use times new roman
Display posts from previous:   
   Index -> Graphics and Design, Web Design -> (X)HTML Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: