Loader ajax/css
- Started
- Last post
- 4 Responses
- quamb0
I've managed to get this far... though can't figure out how to make display=none once the img has loaded. Am guessing this code is horribly wrong...
function movepic(img_name,img_src) {
var loadingdiv = document.getElementById('loading...
loadingdiv.style.display = "block";document[img_name].src=img_src;
var loadingdiv = document.getElementById('loading...
loadingdiv.style.display = "none";
}
- erikjonsson0
must be some kind of best of ajax gallery out there. just popping ajax loader into wordpress plugin search gives a ton of usefull stuff.
my alltime favo is probablty the infinite scroller that took away the pain of pressing next when browsing image feeds
- neverblink0
in your JS function:
1. set loader img to display:visible
2. do AJAX call
3. when call is done display image as background image
4. set loader img to display:noneUnfortunatly img.onload doesn't work well across different browsers
- neverblink0
you need to hide the loader image when the Ajax call was completed