If you don't want to remove the tab content while the ajax call is taking place, you need to modify ajaxtabs.js before you include it in your page like the following manner (highlighted the line that I have commented):
Code:
ddajaxtabs.loadpage=function(page_request, pageurl, tabinstance){
var divId=tabinstance.contentdivid document.getElementById(divId).innerHTML=ddajaxtabssettings.loadstatustext //Display "fetching page message"
if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1)){
document.getElementById(divId).innerHTML=page_request.responseText
ddajaxtabs.ajaxpageloadaction(pageurl, tabinstance)
}
}
As far as your second query is concerned the idea is to find the scrollHeight of the tab's content element in which you have loaded the content now and set the element's height as its scrollHeight explicitly. This can be achieved in the following manner:
Code:
instance.onajaxpageload=function(pageurl){
var tabContentDivElement = document.getElementById(divId);
if(typeof tabContentDivElement === "object"){
tabContentDivElement.style.height = tabContentDivElement.scrollHeight + "px";
}
}
This is a custom event supported by this script. Check the docs for more details about this event.
The important thing regarding this code is I have used a generic code the object name "instance" should be replace with your own ajaxtab object name. Like that "divId" should be replaced with the correct ID value of the div element.
Hope this helps.
Bookmarks