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 4 of 4
  1. #1
    Regular Coder
    Join Date
    Oct 2005
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Exclamation plz test this script

    http://digitalpatriots.org

    next to each main header is '+' for collapsing and uncollapsing the div beneath it.
    It uses cookies to remember the state.

    Some ppl have told me it doesnt work for them. But, I have not had any problems in the latest versions of:

    firefox
    netscape
    opera
    ie7
    ie6

    A friend didnt get it to work in firefox (reformatted pc, fresh install)
    Somebody else said they only got it to work in IE, waiting for a response on what browsers they actaully tested it on.

  • #2
    Banned
    Join Date
    May 2006
    Location
    England
    Posts
    664
    Thanks
    0
    Thanked 84 Times in 84 Posts
    Quote Originally Posted by fatrat View Post
    http://digitalpatriots.org

    next to each main header is '+' for collapsing and uncollapsing the div beneath it.
    It uses cookies to remember the state.

    Some ppl have told me it doesnt work for them. But, I have not had any problems in the latest versions of:

    firefox
    netscape
    opera
    ie7
    ie6

    A friend didnt get it to work in firefox (reformatted pc, fresh install)
    Somebody else said they only got it to work in IE, waiting for a response on what browsers they actaully tested it on.
    It fails in Opera 8.54 due to failure to test for document.styleSheets (supported in Opera 9)

    It fails in Netscape and FireFox as indicated in the console, again failure to test a returned value.

  • #3
    Regular Coder
    Join Date
    Oct 2005
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i have totally rewrote the code

    Code:
    function createCookie(name,value,days) {
    	if (days) {
    		var date = new Date();
    		date.setTime(date.getTime()+(days*24*60*60*1000));
    		var expires = "; expires="+date.toGMTString();
    	}
    	else var expires = "";
    	document.cookie = name+"="+value+expires+"; path=/";
    }
    
    
    function hideme(id, type)
    {
    	var id=id;
    	/*alert(id);*/
    	document.getElementById(id).className ='hideme';
    	/*setStyleById(id, 'display', 'none');*/
    	code='<span class="showmebutton" title="Show" onClick="showme(\'navigation\')">+</span>';
    	document.getElementById('cm_'+id).innerHTML= (code);
    	createCookie(id, 'none', 30);
    }
    function showme(id, type)
    {
    	var id=id;
    	var state='block';
    	if(type=='table'){state='table';}
    	document.getElementById(id).className ='showme';
    	/*setStyleById(id, 'display', state);*/
    	code='<span class="hidemebutton" title="Hide" onClick="hideme(\'navigation\')">-</span>';
    	document.getElementById('cm_'+id).innerHTML= (code);
    	createCookie(id, state, 30);
    }
    
    
    
    html:
    
    <div class="standardheader">
    		<h1> <span class="standardheader-mid"><span class="standardheader-left"></span> <span class="standardheader-right" id="cm_navigation"><span class="hidemebutton" title="Hide" onClick="hideme('navigation')">-</span></span> &nbsp;Navigation</span></h1>
    		<div class="showme" id="navigation">
    		<ul class="row1list">
    			<li><a href="{U_CREATEACLAN}">Create a Clan</a></li>
    			<li><a href="{U_ADDSCRIM}">Add a Scrim</a></li>
    		</ul>
    		</div>
    	</div>
    this seems to work in all browsers

    the problem is the onload, to get them hidden:

    Code:
    <script language="Javascript" type="text/javascript">
    	<!--
    	function checkcookies()
    	{ 
    	var cookielist= new Array(16);
    	cookielist[0]="quickreg";
    	cookielist[1]="twl4";
    	cookielist[2]="mostrecent";
    	cookielist[3]="randompic";
    	cookielist[4]="clansbygame";
    	cookielist[5]="navigation";
    	cookielist[6]="services";
    	cookielist[7]="newspost63";
    	cookielist[8]="twlladderinfo0";
    	cookielist[9]="twlladderinfo1";
    	cookielist[10]="highrated";
    	cookielist[11]="mostviewed";
    	cookielist[12]="newspost20";
    	cookielist[13]="xfire";
    	cookielist[14]="scrimlist";
    	cookielist[15]="aatracker";
    	var xa=0;
    	for(xa=0; xa<16; xa++) 
    	{
    		hideme(cookielist[xa]);
    	}
    	}
     	-->
    	</script>
    in opera it gives this error:

    message: Statement on line 16: Could not convert undefined or null to object
    Backtrace:
    Line 16 of linked script http://digitalpatriots.org/templates...ts_collapse.js
    document.getElementById(id).className = "hideme";
    Line 13 of inline#2 script in http://digitalpatriots.org/index.php...8c3ec55&clan=0
    hideme(cookielist[xa]);
    Line 1 of script
    checkcookies();
    At unknown location
    [statement source code not available]
    Last edited by fatrat; 01-16-2007 at 08:52 AM.

  • #4
    Regular Coder
    Join Date
    Oct 2005
    Posts
    127
    Thanks
    0
    Thanked 0 Times in 0 Posts
    this is giving me such a headache i might give up


  •  

    Posting Permissions

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