PDA

View Full Version : loading image in same place



jackavin
10-19-2007, 01:23 AM
1) Script Title:
ajaxtabscontent
2) Script URL (on DD):
http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm
3) Describe problem:
i have 3 sub tabmenu and i would like the loading image to be in same place
is it posible to bring in to <div id="loading">or something like this and every menu will show loading.gif in same place can i do that?

thank

ddadmin
10-19-2007, 07:27 AM
Sure, inside ajaxtabs.js, change the line:


document.getElementById(containerid).innerHTML=loadstatustext

to something like:


document.getElementById("loadingdiv").innerHTML=loadstatustext

And add to the below the part in red:


if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(containerid).innerHTML=page_request.responseText
document.getElementById("loadingdiv").innerHTML=""
}

Finally, make sure the loading DIV is defined on your page beforehand:


<div id="loadingdiv"> </div>