Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 3 of 3
  1. #1
    New to the CF scene
    Join Date
    May 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question pop up javascript - help?

    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

  • #2
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Add the highlighted:
    Code:
    newwindow=window.open(url,'name','width=800,scrollbars=1');
    For further reading:
    http://www.javascript-coder.com/wind...dow-open.phtml

    Hope that helps.
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #3
    New to the CF scene
    Join Date
    May 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    yey!!! thank you so much that works like a charm!
    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
    cheers!
    PJ


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •