I am trying to disable the top menu for jquery sliding tabs. I want the tabs to tabs to be operated only with previous/next.
Please see my Live Demo.
Jquery:
<script>
$(document).ready(function() {
// Horizontal Sliding Tabs demo
$('div#st_horizontal').slideTabs({
// Options
contentAnim: 'slideH',
contentAnimTime: 600,
contentEasing: 'easeInOutExpo',
tabsAnimTime: 300
});
$(".st_tab_view").each(function(i) {
var totalSize = $(".st_tab_view").size() - 1;
if (i != totalSize) {
next = i + 2;
$(this).append("<a href='#' class='next-tab mover' rel='" + next + "'>Next Page »</a>");
}
if (i !== 0) {
prev = i;
$(this).append("<a href='#' class='prev-tab mover' rel='" + prev + "'>« Prev Page</a>");
}
});
$('.prev-tab').click(function() {
$('.st_tab_active').parent().prev().children('a').trigger('click');
return false;
});
$('.next-tab').click(function() {
$('.st_tab_active').parent().next().children('a').trigger('click');
return false;
});
});
</script>
”
modify your jquery like –
$(‘.prev-tab’).click(function() {
$(‘.st_tab_active’).attr(‘disabled’,’disabled’);
var tab= $(‘.st_tab_active’).parent().prev().children(‘a’);
tab.removeAttr(‘disabled’);
tab.trigger(‘click’);
// tab.attr(‘disabled’,’disabled’);
return false;
});
“