How can I determine if jquery tab is shown because of user click or from tab rotation -
i've been using jquery ui tabs bit , interesting request has come up. current tab setup using rotation feature. need find way determine if tab shown because of result of rotation itself, or because user physically clicked tab.
i've wired of standard events, show , select , fire regardless of source of tab change.
does have ideas? i'd additional if user clicked tab, not if tab changes via rotation.
if wire click tabs doesn't seem fired @ all, i'm assuming because tabs widget using event itself.
edit: here's basic code
<script type="text/javascript"> $(document).ready(function(){ $("#featured").tabs( {show: function(e, ui) { console.log(e);} } ).tabs("rotate", 5000, false); }); </script>
the console show event (e) whether clicked user or shown part of rotation. also, same if change event show: select:
from jqueryui documentation:
this event triggered when clicking tab.
$( ".selector" ).tabs({ select: function(event, ui) { ... } });
Comments
Post a Comment