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
    Regular Coder
    Join Date
    Jun 2012
    Posts
    137
    Thanks
    1
    Thanked 1 Time in 1 Post

    Hidden popup flashes when page loads

    Hello,

    I have a popup that uses JQuery to toggle the visibility of the div containing the popup. The problem is that when I open of refresh the page, the hidden div flashes. Is there an easy way to fix this?

    The first function is called immediately on page load.

    Code:
    function hidePup()
    {
    	$('#popup_parent').toggle(false);
    }
    	
    function showHidePup()
    {
    	$('#popup_parent').toggle();
    }

  • #2
    New Coder
    Join Date
    Jul 2012
    Posts
    67
    Thanks
    14
    Thanked 6 Times in 6 Posts
    Could we get the surrounding DIV code as well?

  • #3
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,694
    Thanks
    25
    Thanked 657 Times in 656 Posts
    Why not use CSS to hide div when html is made?
    Code:
    #popup_parent{
      display:none;
    }
    And jquery is not needed onload.


  •  

    Posting Permissions

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