I know this is a common problem, but I've tried many suggested solutions to no avail. All I'm trying to achieve is for an image to fade in on page load (without briefly appearing for a split second before then disappearing, and fading up).
From what I've read, it's recommended to hide the image first using CSS, so that it shouldn't load until the fadein takes place:
#imgfade {
display: none;
}
I know this working, because if I remove the Jquery, the image doesn't display. Jquery code:
$("#imgfade").fadeIn(600);
I've also tried:
$("#imgfade").hide().fadeIn(600);
It mostly works, but when visiting another site, then returning, the flicker happens. Sometimes going backwards and forwards results in it working 8/10 times, then sometimes flickering.
I've also tried this CSS (with the appropriate matching Jquery) to no avail:
#imgfade {
opacity: 0;
}
I suspect this may be to do with browser caching?
I'm using Bootstrap 3, but the custom CSS (as above) appears after the bootstrap (and other) CSS pages are loaded (in the section within ).
Can anyone recommend a completely fool proof method to avoid this occurring? I'm also getting the same problem with text on some of the other pages.
Many thanks in advance.