0

I'm using a jquery animation to smooth load a same image in every page . However it loads fine in first load but after clicking and navigating to another page the image doesn't load.

Is it because the pages are static html (jekyll) the pages are cached?

The animation works fine when refreshing the page again. Or is their a way to fix it? Or should i use css3 animation?

Code

css

 #myimg {opacity : 0};

js

 $(document).ready(function(){
 $('#myimg').bind('load' , function(){
 $(this).animate({opacity: 1});
});
});
rksh
  • 3,920
  • 10
  • 49
  • 68
  • If cashing is the problem, you can turn it off http://stackoverflow.com/questions/1341089/using-meta-tags-to-turn-off-caching-in-all-browsers – Ram Dec 19 '13 at 02:33
  • first use jquery on instead of bind for jquery > 1.7. What do you mean by static? are you loading only content not the whole page i.e with javascript? – Raunak Kathuria Dec 19 '13 at 02:51
  • Do you have that default gem installed? I can't remember the name of it right now but it's the gem that automatically ajaxifies your page and it's included by default in rails. – Johnston Dec 19 '13 at 02:59
  • turbolinks... That's the name of it. Turbolinks might do this. I don't know if it's included in jekyll. – Johnston Dec 19 '13 at 03:03

0 Answers0