Results 1 to 5 of 5

Thread: Tab Content Script: Reload page on every tab click

  1. #1
    Join Date
    Feb 2011
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Tab Content Script: Reload page on every tab click

    1) Script Title: Tab Content Script (v 2.2)

    2) Script URL (on DD): http://www.dynamicdrive.com/dynamici...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
    Last edited by Snoken99; 03-15-2011 at 09:04 AM.

  2. #2
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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:
    Code:
    				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:
    Code:
    var countries=new ddtabcontent("countrytabs")
    countries.setpersist(true)
    countries.setselectedClassTarget("link") //"link" or "linkparent"
    countries.init()
    DD Admin

  3. #3
    Join Date
    Jun 2011
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default reload a tab content on ervery tab click

    in relation to this, is it possible to reload a tab content with every click on the tabs? tnx...

  4. #4
    Join Date
    Aug 2004
    Posts
    10,143
    Thanks
    3
    Thanked 1,008 Times in 993 Posts
    Blog Entries
    16

    Default

    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 in those cases.
    DD Admin

  5. #5
    Join Date
    Mar 2015
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Tried this and it reload page but not select that tab start from first tab what to do?

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •