Jquery媒体查询

时间:2016-05-16 05:37:17

标签: jquery html css twitter-bootstrap-3 font-awesome

$(window).load(function() {
  var pageWidth = $(window).width(); 

    if ( pageWidth < 800 ) {
        $(".navbar.navbar-inverse").sticky({ 
        topSpacing: 0
    });
    }
});

下面的代码是针对屏幕宽度超过800px的标题扩展并保持在顶部。脚本本身很好,但在移动版本中,上面的部分菜单是不必要的,所以我想根据屏幕大小禁用它,类似于如何通过媒体查询更改和禁用css。我想根据屏幕大小禁用此代码的执行:

i jut need to stick the menu in the mobile version, the top portion (logo and other information) need not be stick as i scroll down.

0 个答案:

没有答案