어떻게 jquery 탭을 만들 수 있습니까? 콘텐츠의 맨 위와 맨 아래에 똑같은 탭 이 있습니까?jquery 탭 복제/복사/미러링
그래서이 2 개 개의 탭이 결합하고, 서로 미러링 :
http://jqueryui.com/demos/tabs/default.html
http://jqueryui.com/demos/tabs/bottom.html
어떻게 jquery 탭을 만들 수 있습니까? 콘텐츠의 맨 위와 맨 아래에 똑같은 탭 이 있습니까?jquery 탭 복제/복사/미러링
그래서이 2 개 개의 탭이 결합하고, 서로 미러링 :
http://jqueryui.com/demos/tabs/default.html
http://jqueryui.com/demos/tabs/bottom.html
이 jQuery를 탭의 총 해킹,하지만 난 이것에 다른 방법을 생각하지 못했습니다 용이하게. 복제 된 탭에만 스타일을 지정해야합니다. 라이브 예제 here을 확인할 수 있습니다. 아주 간단한
$(function() {
var myTabs = $("#tabs").tabs();
var x = $('.ui-tabs-nav').clone().addClass('mySecondTabs');
$('#tabs').append(x);
$('.mySecondTabs').tabs();
$('#tabs').tabs({
select: function(event, ui)
{
index = ui.index;
x = $('.mySecondTabs').children('li:nth-child('+(parseInt(index)+1)+')');
$('.mySecondTabs').children('li').removeClass('ui-tabs-selected').removeClass('ui-state-active');
x.addClass('ui-tabs-selected').addClass('ui-state-active');
}
});
$('.mySecondTabs').children('li').click(function()
{
$('#tabs').tabs("select", $('.mySecondTabs').children('li').index(this));
});
});
그것은`:
이$('#tabs').tabs();
$('#my-text-link').click(function(){
$('#tabs').tabs("option", "active", 1); //open the second tab [0,1,2...]
});
완벽한, 링크 된 페이지가 더 이상 작동하지 않습니다 – Martijn
많이 들으은 (는 HTTP 참조를 다음과 같이
hacked
자바 스크립트 코드는 다음과 같습니다 //www.jqueryui.com/jquery-1.4.2.js가 더 이상 존재하지 않음) – gordon613