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
    140
    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. #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. #3
    Master Coder sunfighter's Avatar
    Join Date
    Jan 2011
    Location
    Washington
    Posts
    6,334
    Thanks
    30
    Thanked 870 Times in 868 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
  •