Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums JavaScript JQuery Tab.UI using Next/Previous – Multiple Instances Re: JQuery Tab.UI using Next/Previous – Multiple Instances

#81531
jjmclaw
Member

Hey,

The code I used was this:

Code:
<script type="text/javascript">
$(function() {

var $tabs = $(‘#tabs’).tabs();

$(".ui-tabs-panel").each(function(i){

var totalSize = $(".ui-tabs-panel").size() – 1;

if (i != totalSize) {
next = i + 2;
$(this).append("<a href=’#’ class=’next-tab mover’ rel=’" + next + "’></a>");
}

if (i != 0) {
prev = i;
$(this).append("<a href=’#’ class=’prev-tab mover’ rel=’" + prev + "’></a>");
}

});

$(‘.next-tab, .prev-tab’).click(function() {
$tabs.tabs(‘select’, $(this).attr("rel"));
return false;
});

});
</script>