SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist dhtmlhelp's Avatar
    Join Date
    May 2003
    Posts
    575
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Hidden Content and Flickering

    Hi,

    I am using the following code to hide a <tr>. The script does its job, however before hiding the <tr>, when the cookie is set to true the hidden content flickers for half a second before being hidden. Is there something I am doing wrong or is the problem in style.display="none";?

    Code:
    function ShowHide(DivId)
    	{	
    		var DivId=document.getElementById(DivId);
    		if(document.form3.showhide.checked==false)
    		{
    			DivId.style.display = "inline";
    			createCookie("showhide","");
    		}
    		else  
    		{
    			DivId.style.display="none";	
    			createCookie("showhide","true");
    		}
    	}
    DH

  2. #2
    Winemaster bronze trophy BonRouge's Avatar
    Join Date
    Oct 2004
    Location
    Sendai, Japan
    Posts
    2,417
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Have you thought about doing it the other way around - put 'display:none' in the css and let it show if it's needed?
    Some might say this is kind of not very accessible because those without javascript couldn't get to see the row, but...
    (I've had a similar problem myself recently by the way, and this is what I decided to do. No inaccessibility issues for me though as it was for an intranet project).

  3. #3
    SitePoint Evangelist dhtmlhelp's Avatar
    Join Date
    May 2003
    Posts
    575
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Actually we are not making the page reload for this. A checkbox activates the hiding and sets the cookie. If cookie true then style display none.

    Am I missing something?

    DH


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
  •