📜  窗口宽度 onload jquery - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:01:24.902000             🧑  作者: Mango

代码示例1
function resizeLogic() {
    if ($(window).width() < 620) {
        $("#prd_details_smaller").append('.product_title, .product_code, .prd_reviews');
        $("#short_desc").hide();
    } else {
        $(".col_prd_rgt").prepend('.product_title, .product_cod, .prd_reviews');
        $("#short_desc").show();
    };
}
resizeLogic(); // on load
$(window).resize(resizeLogic); // on window resize