How can I bind to jQuery UI tab event click/select/active? -
i'm beginner/intermediate level developer/programmer. i've got jquery-ui-tabs i'm building in jquery (they show , function fine):
var paymenttabs = $('<div id="paytabs">'); ... var paymenttablist = $('<ul>'); paymenttabs.append(paymenttablist); if($.inarray('check',options.methods) != -1){ paymenttablist.append('<li><a href="#pay-by-check">pay e-check</a></li>'); paymenttabs.append(paybycheck); } if($.inarray('card',options.methods) != -1){ paymenttablist.append('<li><a href="#pay-by-card">pay credit/debit card</a></li>'); paymenttabs.append(paybycard); } if($.inarray('code',options.methods) != -1){ paymenttablist.append('<li><a href="#pay-by-code">business office use only</a></li>'); paymenttabs.append(paybycode); } paymenttabs.tabs({show: function(event, ui) { item.currentmethod = ui.panel.id; self._refreshcart(); } }); paymenttabs.tabs({show: function(event, ui) { item.currentmethod = ui.panel.id; self._refreshcart(); } });
binding them not work:
$( "#paytabs" ).on( "tabsselect", function(event, ui) { alert("tab has been clicked."); });
neither this:
$( "#paytabs" ).bind( "tabsselect", function(event, ui) { alert("tab has been clicked."); });
i tried tabsactivate instead of tabsselect. tried selecting class , id. tried selecting transverse , walking dom. eventually, i'm going use function bind tab, add 3% fee billing total. make function change json key, attribute "required" "true" specified input element. critical me function bound... appreciate help.
look here: http://api.jqueryui.com/tabs/#event-activate
bind tab 'activate' event. when tab clicked activate function fired.
like this:
$("#paytabs").tabs({ activate: function( event, ui ){ /* here */ } });
or
$("#paytabs").on( "tabsactivate", function( event, ui ){ /* here */ });
Comments
Post a Comment