PDA

View Full Version : Tab Content Script: Reload page on every tab click



Snoken99
03-15-2011, 08:33 AM
1) Script Title: Tab Content Script (v 2.2)

2) Script URL (on DD): http://www.dynamicdrive.com/dynamicindex17/tabcontent.htm

3) Describe problem:

Is it possible to have the script reload the whole page everytime I press a tab? Now I need to press refresh in the browser for the whole page to reload. I tried change the setpersistant() to false but it didn't do any different.

Regards,
Goran

ddadmin
03-16-2011, 01:26 AM
Are you asking how to basically refresh the page whenever a tab is clicked on? The original purpose of Tab Content script is to not have to do that to view new content actually. Anyhow, to do just that, try adding the line in red to the .js file:


this.tabs[i].onclick=function(){
tabinstance.expandtab(this)
location.reload()
tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
return false
}

And as far as getting the selected tab to persist when the page reloads, did you call setpersist()? For example:


var countries=new ddtabcontent("countrytabs")
countries.setpersist(true)
countries.setselectedClassTarget("link") //"link" or "linkparent"
countries.init()

yinbry
06-21-2011, 05:48 PM
in relation to this, is it possible to reload a tab content with every click on the tabs? tnx...

ddadmin
06-22-2011, 08:14 AM
yinbry: I think what you're really asking is how to refresh a portion of a page's content, which the tab contents being defined inline on the page would qualify as. Unfortunately there is no quick way to do that, unlike iframe or ajax fetched content. There is the Ajax Tabs Content script (http://www.dynamicdrive.com/dynamicindex17/ajaxtabscontent/index.htm) in those cases.

huzoorbux
03-24-2015, 01:54 PM
Tried this and it reload page but not select that tab start from first tab what to do?