Results 1 to 3 of 3

Thread: 3D spinning message

  1. #1
    Join Date
    May 2007
    Location
    Mythica
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Unhappy 3D spinning message

    1) Script Title: 3D spinning message


    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici.../circlemsg.htm

    3) Describe problem: How can I make the spinning message load only once upon entering my site.

    Right now if you click the return to "Home" link it loads, or if you have to refresh a page it loads, or if I am up dating a page it loads.

    I would really appriecate some help please and thank you.

    SilverWolf

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    28,926
    Thanks
    43
    Thanked 3,192 Times in 3,155 Posts
    Blog Entries
    12

    Default

    You would need a cookie for that. Near the end of the script, where it has:

    Code:
    	if (window.attachEvent) //DD added code
    	window.attachEvent("onload", changeform) //DD added code
    	else
    	window.onload=changeform
    Make it like so:

    Code:
    	if(!readCookie('spinner')){
    	if (window.attachEvent) //DD added code
    	window.attachEvent("onload", changeform) //DD added code
    	else
    	window.onload=changeform
    		}
    	createCookie('spinner');
    And add this cookie code from quirksmode.org just before the </script> tag:

    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 readCookie(name) {
    	var nameEQ = name + "=";
    	var ca = document.cookie.split(';');
    	for(var i=0;i < ca.length;i++) {
    		var c = ca[i];
    		while (c.charAt(0)==' ') c = c.substring(1,c.length);
    		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
    	}
    	return null;
    }
    
    function eraseCookie(name) {
    	createCookie(name,"",-1);
    }
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. The Following User Says Thank You to jscheuer1 For This Useful Post:

    SilverWolf (02-22-2008)

  4. #3
    Join Date
    May 2007
    Location
    Mythica
    Posts
    24
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Oh so cool it worked thank you so much

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
  •