JavaScript test

Javascript code posted by murphy < Jamis Buck
created at 17 Oct 17:39, updated at 07 Nov 04:29

Edit | Back
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
document.observe("dom:loaded", function() {
  $(document.body).observe("click", function(event) {
    var element = event.findElement("a[data-toggle]");
    if(element) {
      var action = element.readAttribute("data-toggle");
      element.hide();
      element.next().show();
      event.stop();
    } else {
      var element = event.element();
      if(!element.readAttribute("data-tab")) element = element.up("a[data-tab]")
      if(element) {
        selectTab(element.readAttribute("data-tab"));
      }
    }
  });
});
543 Bytes in 3 ms with coderay