slot
judi slot
slot online
slot88
slot gacor
daftar slot
link slot
slot online terpercaya
situs slot
apizeus777
slot gacor hari ini
slot777
situs judi slot
situs slot online
situs slot gacor
slot gacor terpercaya
slot terpercaya
situs slot gacor hari ini
slot88 resmi
slot88 online
slot zeus
zeus slot
slot77
slot rtp
rtp slot
slot88
situs slot
slot
slot gacor
slot online
daftar slot
link slot
slot online terpercaya
slot gacor hari ini
judi slot
apizeus777
link slot gacor
slot tepercaya
situs judi slot
slot77
zeus slot
daftar slot gacor
judi slot gacor
slot gacor terpercaya
situs slot online

Hướng dẫn hiển thị tabs dạng menu mobile với jquery – flatsome

Cách chuyển hiển thị dạng tabs thành menu mobile.

Sử dụng css kết hợp với js để khi hiển thị lên mobile nhìn sẽ dẹp mắt hơn.

Ví dụ dưới đây mình sử dụng theme flatsome nhé mọi người, theme nào cũng vậy miễn có chức năng tabs là các bạn có thể làm được.

B1: Đầu tiên mình sẽ tạo một tabs với class là producttabs

Rồi ở các tab panel thì mình bỏ sản phẩm vào bình thường thôi, quan trọng là cái class mà các bạn đặt, đặt ntn cũng được miễn trong script mình gọi đúng là được.

B2: Kết tiếp là css cho nó, các này các bạn tự sáng tạo nhé.

Đây là hiển thị của tabs trên mobile sau khi thêm vào.

Việc cần làm là dùng css để hiển thị cái nút menu-mobile và ẩn hết các tab panel nhé

CSS ẩn tab panel.

.icon-custom{
display:none
}
@media screen and (max-width: 900px) {
.producttabs button.icon-custom{
font-size:13px!important;
display:block;
margin-right: 0;
font-size: 1.2em;
float: right;
}
.producttabs .nav li{
display:none;
}
.producttabs .nav.reshow li{
float: none;
display: block;
text-align: right;
width: 100%;
}
.producttabs h4{
float: unset;
width: 100%;
}
.producttabs ul{
float: unset;
width: 50%!important;
margin-left: 50%;
position: absolute;
z-index: 100;
right: 0;
}
.producttabs .nav-tabs>li>a{
width: 100%;
text-align: right;
}
.icon-custom{
position:absolute;
top:0;
right:0;
}
}

Và các tab panel sẽ ẩn đi như thế này.

B3: Kế đến là dùng js để hiển thị icon menu và chức năng click gọi từng tabs

Dán đoạn script này vào flatsome->advanced

Đoạn JS như sau:

<script>
jQuery(document).ready(function($) {
jQuery(‘.producttabs h4’).after(‘‘);
jQuery(‘button’).click(function(){
jQuery(this).next(‘ul’).toggleClass(“reshow”);
});
jQuery(document).click(function(e) {
var target = e.target;
if (!jQuery(target).is(‘.icon-custom’) && !jQuery(target).parents().is(‘.icon-custom’)) {
jQuery(‘.producttabs .nav’).removeClass(‘reshow’);
}
});
jQuery(‘.producttabs .nav li a’).click(function(){
jQuery(‘.producttabs .nav’).removeClass(‘reshow’);
});
});
script>

Kết quả:

Cảm ơn mọi người đã theo dõi bài viết. Mọi ng nhớ ủng hộ mình để có động lực viết blog tiếp nhé

Bài Viết Liên Quan

togel
togel hk
togel singapore
togel hongkong
situs togel
hongkong togel
situs togel terpercaya
togel sgp
toto sgp
togel hongkong hari ini
togel terpercaya
sgp toto
link togel terpercaya
link togel
buku mimpi
buku mimpi togel
link togel terpecaya
situs toto terpercaya
situs togel online
mimpi togel
api777
Sip33
slot
judi slot
slot online
slot88
slot gacor
daftar slot
link slot
slot online terpercaya
situs slot
apizeus777
slot gacor hari ini
slot777
situs judi slot
situs slot online
situs slot gacor
slot gacor terpercaya
slot terpercaya
situs slot gacor hari ini
slot88 resmi
slot88 online
apibet
link slot bet 100
slot 200
slot 100
slot bet 100
slot bet 200
situs slot bet kecil
situs judi slot
slot 100 perak
link apibet
slot online terpercaya
link slot
slot
daftar slot
judi slot
slot gacor
situs slot online
situs slot terpercaya
slot88
APINAGA
API NAGA
APINAGA LOGIN
API777
API777
super33
super33 slot
super33 login
api33
api33
api777
api777
api777
api777
api777
api777
api777

0975.249.444

Contact Me on Zalo