...

View Full Version : pop up javascript - help?



PoohJoon
05-31-2008, 03:27 AM
Hello,
I'm a novice and have been using the following for pop ups because it was the first one I found (that I could understand!) that prevented pages from jumping back to top when a new window opened.
It works great for most of the pop ups I need, except ones that contain a large amount of content (eg: an article, someone else's website) where scrolling is required.
Could someone please pretty please help me either figure out how to adjust this code to allow scrolling, or a better code to use.

JAVASCRIPT

function popitupArticles(url) {
newwindow=window.open(url,'name','width=800');
if (window.focus) {newwindow.focus()}
return false
}


HTML
<a href="newsArticle.html" onclick="return popitupArticles('newsArticle.html')">News Article</a>

Thank you very much for your time!
PJ

rangana
05-31-2008, 03:38 AM
Add the highlighted:


newwindow=window.open(url,'name','width=800,scrollbars=1');


For further reading:
http://www.javascript-coder.com/window-popup/javascript-window-open.phtml

Hope that helps.

PoohJoon
05-31-2008, 04:50 AM
yey!!! thank you so much that works like a charm! :thumbsup:
phew! i'm so glad i didn't have to change a bunch of code :)

thank you for helping a self taught designer learn something new :cool:
cheers!
PJ



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum