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
    Feb 2007
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Unhappy Position of Pop up menu!!

    As i mouse over on a link pop up menu is visible, but i want to make it visible at a certain position of a screen so that it is clearly seen and the Pop up menu window doesn't get cut from anywhere. Can anyone tell me how to change the Position of pop up window. I m new in coding

  • #2
    New Coder
    Join Date
    Dec 2006
    Posts
    80
    Thanks
    1
    Thanked 0 Times in 0 Posts
    Hello Harsha,

    Without having seen your code I can only make a very rough guess at what you want.

    Assuming the id of your popup is myPopUp:

    myPopUp.style.pixelTop = "250px" //250px from top of screen
    myPopUp.style.pixelLeft = "260px" //250px from left of screen

    To cope with different resolutions, you may have to do something a bit more complex. Look up css positioning on Google.

    HTH
    Joe

  • #3
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,589
    Thanks
    0
    Thanked 644 Times in 634 Posts
    If your visitor has their browser configured to disallow moving and resizing browser windows from the web page then your popup will open where their browser is configured to put it at the default size and nothing you do can change it. You can suggest a size and position in the third parameter of the window.open() call that opens the popup where at least you have a chance that it may take effect.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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