Best reference link
Tab selection
-
$('#myTab a[href="#profile"]').tab('show'); // show tab targeted by the selector
-
$("#myTab a:first").tab('show'); // show first tab
-
$("#myTab a:last").tab('show'); // show last tab
-
$("#myTab li:eq(2) a").tab('show'); // show third tab (0-indexed, like an array)
May 29, 2014 at 1:03 pm
Droupdown JS function
$(‘#the-dropdown’).click(function () {
if($(this).hasClass(‘open’)) {
alert(‘it works’);
}
});
May 29, 2014 at 1:06 pm
$(document).ready(function() {
$(‘#dropdown’).data(‘open’, false);
$(‘#dropdown-button’).click(function() {
if($(‘#dropdown’).data(‘open’)) {
$(‘#dropdown’).data(‘open’, false);
update_something();
} else
$(‘#dropdown’).data(‘open’, true);
});
$(document).click(function() {
if($(‘#dropdown’).data(‘open’)) {
$(‘#dropdown’).data(‘open’, false);
update_something();
}
});
});