I have a div that is being slide from off the page with .animate automatically when you come to the page. I have it working on first visit, but when the site becomes cached and you revisit, the function seems not to fire. A few refreshes eventually gets it going again but I need it to be reliable.
It seems to be that I need to be able to "reset " the script so even on a cached site it fires again.
This is the script I'm running now.
$(document).ready(function(){
$("#logo_fixed img").bind("load", function () { $(this).animate({"left": "+=434px"}, "slow"); });
});
The img is position:absolute and set off the page in the css
I have tried a few different ways of doing this, But I have the issue of also needing the image to be loaded before it is slide in. And don't want it to be the last thing to come up.
I also tried
$(document).ready(function() {
$('#logo_fixed img').load(function(){
$(this).animate({"left": "+=434px"}, "slow")
});
});
Same results, if the site is cached it wont fire, but a reload will get it working.
If Anyone has any help I would greatly appreciate it thanks!