1
kaper
MyTabs 2.21 Persistent option bug
  • 2013/5/16 15:04

  • kaper

  • Just popping in

  • Posts: 75

  • Since: 2003/4/26


MyTabs 2.21 over XOOPS 2.5.6

I want the MyTabs to remember the tab recently selected. I mean, when I click a tab (containing a link) ant the linked page loads, I want the recently clicked tab to remain selected.

If I select Use Persist and Use Onmouseover in the MyTabs block settings, the selected tab is remembered through the page reload. However, I want to have the onmouseover turned off (why - I explain later).

So if Use Persist only is selected, the recently selected tab is not remembered through the page reload - after clicking any tab and loading the linked page, always the first tab (from the left) is selected. Eventually always and only the first tab can be active.

I will appreciate explaining whether that is a bug and how to fix it. Yet I haven't determine how the information about the selected tab is passed through the page reload.


(I want to have the onmouseover turned off, because if it is on and I accidentally hover the mouse over any tab, that random tab becomes selected, thus making the selected tab inconsistent with the page content (I want to use the tabs as a navigation menu)

2
kaper
Re: MyTabs 2.21 Persistent option bug
  • 2013/5/22 11:43

  • kaper

  • Just popping in

  • Posts: 75

  • Since: 2003/4/26


I revealed it.
To gain a tab-style menu, you should insert a "#" (hash) as a "Links to:" in tab settings. Then, provided Use persist =Yes and Use onmouseover = No in the MyTabs block settings, you can switch between tabs and the switched position is remembered.
When you click a tab, it expands and you can access any content of the tab, that you have set in the Tab Manager.
It doesn't matter whether "#" is the only content of the Link To: field or it is included in any longer string. Actually , the position of "#" in the string is checked - if is >=0, the tab is expanded.

The above is as described in the mytab/doc/readme.txt.
It lacks a small feature I need.
When I click a tab, I want not to expand the tab (to get a kind of "submenu"), but I want just to be redirected to another page, which will include the tabs and that tab will remain selected.
I did it in a quite simple way:

mytabs/jscript/tabcontents.js, function init, lines below 154
this.tabs[i].onclick=function(){
                            
tabinstance.expandtab(this)
                            
tabinstance.cancelautorun() //stop auto cycling of tabs (if running)
                  
location.this.tabs[i].getAttribute("href"// added by kaper
                            
return false
                        
}

The onclick function just opens the URL after expanding the tab (and writing info about the selected one to cookie via the expandtab function).

3
kaper
Re: MyTabs 2.21 Persistent option bug
  • 2013/5/27 9:36

  • kaper

  • Just popping in

  • Posts: 75

  • Since: 2003/4/26


The above doesn't work in Ms Internet Explorer. The line should be
window.open(this.tabs[i].getAttribute("href"),_self)

Login

Who's Online

413 user(s) are online (296 user(s) are browsing Support Forums)


Members: 0


Guests: 413


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits