Long shot but can anyone tell me how to accomplish this?

Awesome. Thank you so much. :slight_smile: Iā€™ll play with it in the morningā€¦

Good morning,

Anyway to make it on by default. And I hate to say, but animation turns on again after about a minute after being turned off. Just open another tab and then come back to it after a bit and youā€™ll see.

Good evening,

I just had a look at the page (in Chrome and Firefox), but for me, when I turn the animation off (it was on both times by default), it stays off.
I checked after five, ten and fifteen minutes.

Did you maybe fix this issue in the meantime?

No I didnā€™t. Was it the same link? Ill try clearing the cache. I never really consider that because I clear my cache obsessively every 5 minutes

I used the link in your signature.
Should I have been looking at my demo page?

Oh ya. I was looking at your demo. I still havnt tried to add it to mine yet. Still working in more pressing issues. Like 100+ broken links. Now that is tedious.

Ah ok, I stopped the animation on my demo and youā€™re right, it kicks back in again after a while.
Let me have a look at it now.

So, I got it sorted out.
Hereā€™s a new demo. Can you confirm that the animation stops and stays stopped.

Yep I think that did it! One last thing. Is there a way to make it ON by default and not off as it is currently? Thanks Pullo for all your help :slight_smile:

Youā€™re welcome :slight_smile:

The problem was that the calls to setTimeout were all stacking up, so despite clearing the two obvious ones (t1 and t2), there were still three hanging around in the background, which is why the clouds and left balloon kicked back in again.

Anyway, re default state: it is ā€œonā€ by default.

This line:

if (animationStatus == null || animationStatus == "on")

checks to see if a cookie exists (i.e. if the visitor has pressed the ā€œoff buttonā€ before), if not, the animation kicks right in.

If you mean that the browser should only remember the userā€™s preference for the current session, then just remove the ā€œexpiresā€ bit when you are setting the cookies:

$.cookie('animationStatus', 'on', { expires: 7, path: '/' });
$.cookie('animationStatus', 'off', { expires: 7, path: '/' });

should become:

$.cookie('animationStatus', 'on', { path: '/' });
$.cookie('animationStatus', 'off', { path: '/' });

Hope that helps

So when I click the animation on (yet I have clicked off before in the past) and then open a new tab and load up the page the animation is off by default. Am I missing something? Thanks!

So, first off, we are talking about this demo.

When I click the animation on in Chrome, open another tab an reenter the URL, animation is on in both tabs.
Which browser are you testing in.
Can you tell me how to reproduce the error?

Hey Pullo. :slight_smile: I was testing this on the ipad. Which usually gives the same results. Iā€™ll test it on the desktop in the morningā€¦

Hi Eric,

FWIW I just tested on my iPad, too and got the same result, i.e. all good.

ahh! I had to clear cookies too. Looks like the old cookie was sticking. All is good. Awesome.

Pullo - I copied it all and have a working copy. Can you do me a favor (as if you havent already) and either delete that test page from your server or remove all its text and titles. No duplicate content ya know? Thanks

Ok Pullo I got another one for you. Very simple prob. I need to take the positioning out of the JS and into the css. So when it is turned off everything positions correctly. Thatā€™s the only way I can see how to do it. I messed with it a while but couldnā€™t seem to make it happen. Thanks for you help

Ok. Challenge accepted :slight_smile:
Make me a bare bones page with everything positioned in the CSS how you would like it (i.e. in its start position).
Please also try to strip out all unnecessary styles and content.
When youā€™ve done this, let me know.

Thanks Pullo. :slight_smile: Here is the striped page http://www.websitecodetutorials.com/projects/test-animation-on-off2.php.

Simple (for you) I just need to take the positioning out of this js so I can put it in the css.

function startAnimation(){
animateTwoWay($(ā€˜#balloon1ā€™),{bottom: 350}, {bottom: 125}, 35000, 7000);
animateTwoWay($(ā€˜#balloon2ā€™),{bottom: 450}, {bottom: 200}, 25000, 5000);
animateMe($(ā€˜#nearcloudsā€™),{right: w}, {right: -1268}, 100000, 103000);
animateMe($(ā€˜#farcloudsā€™),{right: w}, {right: -1068}, 150000, 153000);
animateMe($(ā€˜#planeā€™),{left: w}, {left: -606}, 50000, 53000);

Thanks man,
Iā€™ll have a look at this tomorrow.

Hi Eric,

I just sat down to look at this.
Before I got started, I looked at your website again and noticed that when you turn the animation off, everything returns to its original position.

Did you get this sorted out or did I misunderstand what you want?