[英]sliding the tabs with left and right
https://codepen.io/texirv/pen/MvXZQX?editors=1111 https://codepen.io/texirv/pen/MvXZQX?editors=1111
.right {
transform: rotate(-45deg);
-webkit-transform: rotate(-45deg);
}
.left {
transform: rotate(135deg);
-webkit-transform: rotate(135deg);
}
$('.left').click(function(){
console.log("I am testing");
})
You will need to find the current active tab and click on the next/prev tab based on the button clicked. 您需要找到当前活动选项卡,然后根据单击的按钮单击下一个/上一页选项卡。
Here is an example of the code you can use: 以下是您可以使用的代码示例:
$('.left').click(function(){
move('left');
})
$('.right').click(function(){
move('right');
})
function move(to) {
var current = $('li.current').index();
var total = $('.tabs .tab-link').length;
var add;
switch (to) {
case 'left':
add = -1;
break;
case 'right':
add = 1;
break;
}
$('.tabs li.tab-link').eq((current+add)%total).click();
}
This is the update based on your codepen: 这是基于您的codepen的更新:
https://codepen.io/anon/pen/XaYGRM https://codepen.io/anon/pen/XaYGRM
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.