2021-06-17 10:07:43 +00:00
|
|
|
;(function($, win, undefined) {
|
|
|
|
// ECMAScript 5 嚴格模式
|
|
|
|
'use strict';
|
|
|
|
$(document).ready(function() {
|
|
|
|
var timeout_id;
|
2021-07-14 04:57:47 +00:00
|
|
|
if (window.innerWidth < 768) {
|
|
|
|
if($('.mobile-menu .modules-menu').length == 0){
|
|
|
|
$(".modules-menu").appendTo('.mobile-menu');
|
|
|
|
}
|
|
|
|
}
|
2021-06-17 10:07:43 +00:00
|
|
|
$(window).resize(function() {
|
|
|
|
window.clearTimeout(timeout_id)
|
|
|
|
if (window.innerWidth < 768) {
|
2021-07-14 04:57:47 +00:00
|
|
|
if($('.mobile-menu').length != 0){
|
|
|
|
timeout_id = setTimeout(function(){
|
|
|
|
if($('.mobile-menu .modules-menu').length == 0){
|
|
|
|
$(".modules-menu").appendTo('.mobile-menu');
|
|
|
|
}
|
|
|
|
}, 500);
|
|
|
|
}
|
2021-06-17 10:07:43 +00:00
|
|
|
} else {
|
2021-06-22 10:53:14 +00:00
|
|
|
if($("div.aside").length == 0){
|
|
|
|
timeout_id = setTimeout(function(){
|
|
|
|
if($('.mobile-menu .modules-menu').length > 0){
|
|
|
|
$("header .container").append($('.mobile-menu .modules-menu'))
|
|
|
|
}
|
|
|
|
}, 500);
|
|
|
|
}else{
|
|
|
|
timeout_id = setTimeout(function(){
|
|
|
|
if($('.modules-menu').length > 0){
|
|
|
|
$("div.aside").eq(0).append($('.modules-menu'))
|
|
|
|
}
|
|
|
|
}, 500);
|
|
|
|
}
|
2021-06-17 10:07:43 +00:00
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}(jQuery, window));
|