SitePoint Sponsor

User Tag List

Results 1 to 4 of 4
  1. #1
    SitePoint Addict Volitics's Avatar
    Join Date
    Aug 2003
    Location
    US
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How do I refine popup window so it looks, works better?

    Below is the code for a JavaScript popup window. It works the way it is but I'm wanting to make it work better. The problem(s) that I am having are described below:
    PHP Code:
    // ---  ClickPage.php   -------


    <!--
    function 
    MM_openBrWindow(theURL,winName,features) {
      
    window.open(theURL,winName,features);
    }
    -->



    // ### Problem One. ###
    // The ClickPage.php page goes all the way back to the top of the page when you click on the popup window. Once the user clicks on the "Click Here" link the JavaScript window pops up and then the user has to scroll all the way back down the ClickPage.php to get back to where he was before clicking "Click Here". I would like for the ClickPage.php page to not move or stay stationary whenever the "Click Here" link is clicked.

    // ### Problem Two. ###
    // When you pass the mouse over "Click Here" it says "http://www.mysite.com/ClickPage.php#" down in the status bar. What I would like is for the status bar to say something like 'Javascript Popup' or something rather than the "http://www.mysite.com/ClickPage.php#" It would look more professional for the status bar to show something other than the URL for ClickPage.php. 

    <a href="#" onClick="MM_openBrWindow('Explain.html','TextWindow','scrollbars=no')" >Click Here</a>


    // ---- 
    Thanks.
    .

  2. #2
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    To keep the page from returning to the top, add a "return false" after the popup command:

    Code:
    <a href="#" onClick="popup(); return false;">link</a>
    For the status bar text, use window.status = 'Whatever';

    Code:
    <a href="#" onClick="MM_openBrWindow('Explain.html','TextWindow','scrollbars=no'); return false;" onMouseOver="window.status='Popup Window';">Link</a>
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches

  3. #3
    SitePoint Addict Volitics's Avatar
    Join Date
    Aug 2003
    Location
    US
    Posts
    280
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    thanks
    .

  4. #4
    masquerading Nick's Avatar
    Join Date
    Jun 2003
    Location
    East Coast
    Posts
    2,215
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sure thing.
    Nick . all that we see or seem, is but a dream within a dream
    Show someone you care, send them a virtual flower.
    Good deals on men's watches


Bookmarks

Posting Permissions

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