html - Jquery Ui Tabs Current Container display Issue -
first please visit fiddle: http://jsfiddle.net/vsqq3/
currently first 3 tabs ( tab 1
, tab 2
, tab 3
) in display default, , when click on next>
: tab 4
, tab 5
, tab 6
being in displayed.
what want: want display tab 4
, tab 5
, tab 6
default. how can that?
$(".wrapper #tab1,.wrapper #tab2").tabs({active: 0}).tabs({ collapsible: false, hide: { effect: "slideup", duration: 20 }, show: { effect: "slidedown", duration: 200 } }); var = $('.wrapper .main').addclass("passiv"); var prev = $('.wrapper .prev'); var next = $('.wrapper .next'); var tab_count = all.length-1; var currentcontainer = -1; prev.click(function(e) { e.preventdefault(); if (currentcontainer != 0) { currentcontainer -= 1; ctrlcontent(currentcontainer); } }); next.click(function(e) { e.preventdefault(); if (currentcontainer < tab_count) { currentcontainer += 1; ctrlcontent(currentcontainer); } }).trigger('click'); function ctrlcontent(index_to_show) { all.removeclass("active").addclass("passiv"); all.eq(index_to_show).removeclass("passiv").addclass("active"); if (index_to_show == 0) prev.hide(); if (index_to_show == tab_count) next.hide(); if (index_to_show > 0) prev.show(); if (index_to_show < tab_count) next.show(); } $(function() { $( ".wrapper .inner" ).buttonset(); });
if following line:
var currentcontainer = -1;
you can change
var currentcontainer = math.floor(all.length / 2) - 1; // -1 needed indexing seems start @ -1 rather 0
and should start on middle container
Comments
Post a Comment