I’m using the following code to fade in images:
<script>
$(window).load(function(){
$('.slides_control img').css('display', "none');
$('.slides_control img').fadeIn(800);
});
</script>
However, anytime I browse back/forward, with my links, or the browser’s back/forward buttons, I tend to get a flicker. It’s random. On initial load it never happens.
So, do I need to set a time out..? Prevent caching..? Or, is there a better method..?
I have also hidden .slides_control img in my css file.
Using:
http://jsfiddle.net/fhF5E/
It does flicker when you click Refresh several times in a row.
Using:
http://jsfiddle.net/fhF5E/1/
I haven’t been able to get it to flicker once.
Even this doesn’t flicker:
http://jsfiddle.net/fhF5E/3/
EDIT
After reviewing the actual page that demonstrated the problem, it was discovered that the
display: nonewas being applied to theimgin such a way that on page load, thedisplay: noneselector was not selecting anything, but then was selecting after the slider effect was added (on ready).So…
Needs to change to: