Changeset 43676 in spip-zone


Ignore:
Timestamp:
Jan 19, 2011, 10:52:35 PM (10 years ago)
Author:
nicolas@…
Message:

Une ancre dans l'URL selectionne l'onglet qui porte l'id correspondant

File:
1 edited

Legend:

Unmodified
Added
Removed
  • _plugins_/onglets_texte/javascript/mes_onglets.js

    • Property svn:eol-style set to LF
    r43670 r43676  
    9090        var cs = el.childNodes;
    9191        var n;
     92  var numTab = 0;
    9293        for (var i = 0; i < cs.length; i++) {
    9394                if (cs[i].nodeType == 1 && cs[i].className == "tab-page") {
     95      if (window.location.hash == '#' + cs[i].id) {
     96          // select the tab identified by the hash in the URL
     97          this.selectedIndex = numTab;
     98      }
    9499                        this.addTabPage( cs[i] );
     100      numTab++;
    95101                }
    96102        }
Note: See TracChangeset for help on using the changeset viewer.