2016-09-11 8 views
2

私はjQuery mash menu pluginを使用していますが、ページ上部に固定メニューがありますが、応答して固定メニューがdisplay:blockに設定されていません。ページリフレッシュ後はdisplay:blockに設定されていますが、プラグインのプラグインやHTML構造を削除しても問題ありません。私は問題がマッシュメニューのプラグインであると思うが、私はこのプラグインを使用しなければならない。jQueryはページ更新後に動作します

固定メニューの仕組みは?

私の固定メニューはデフォルトでは表示されませんが、予約ページまでスクロールすると、display:blockが設定されます。 (ちょうど応答< 768px)

編集:ちょうどメニューは固定されていない - トップメニューに戻る

$('.mash-menu').mashableMenu({ 
       separator      : true,  //-- Options (true) or (false). This option is used to show the vertical line between menu list items 
       ripple_effect     : false,  //-- Options (true) or (false). This option is used to on - off the google ripple effect on menu items. Which is shown on mouse click 
       search_bar_hide    : false,  //-- Options (true) or (false). This option is used to hide the search bar 
       top_fixed      : false,  //-- Options (true) or (false). This option is used to fixed the menu top of the screen. Note: If this option becomes true then the sticky_header option will not work 
       full_width      : false,  //-- Options (true) or (false). This option is used to make the menu full with 
       right_to_left     : false,  //-- Options (true) or (false). This option is used to align the menu items right to left side order 
       trigger      : 'hover', //-- Options (click) or (hover). This option is used to showing the drop down on mouse click or mouse hover 
       /* VERTICAL TABS */ 
       vertical_tabs_trigger   : 'click', // Options (click) or (hover). This option is used to showing the vertical tabs on mouse click or mouse hover 
       vertical_tabs_effect_speed  : 400,  // Value in milliseconds. This option is used to change the vertical tabs showing or hiding speed 
       /* RESPONSIVE TABS */ 
       //responsive_tabs_effect_speed : 200,  // Value in milliseconds. This option is used to change the responsive tabs showing or hiding speed 
       /* DROP DOWN */ 
       drop_down_effect_in_speed  : 200,  // Value in milliseconds. This options is used to change the drop downs showing speed 
       drop_down_effect_out_speed  : 200,  // Value in milliseconds. This option is used for change the drop downs hiding speed 
       drop_down_effect_in_delay  : 200,  // Value in milliseconds. This option is used to change the drop downs showing delay speed. It means drop down shows after some time 
       drop_down_effect_out_delay  : 200,  // Value in milliseconds. This option is used to change the drop downs hiding delay speed. It means drop down hides after some time 
       outside_close_dropDown   : true,  // Options (true) or (false). This option is used to hide the showing drop downs when user click outside the menu 
       /* STICKY HEADER */ 
       mobile_search_bar_hide   : false,  //-- Options (true) or (false). This option is used to hide the search bar on mobile mode 
       mobile_sticky_header   : false,  //-- Options (true) or (false). This options is used to make the menu sticky on top of the screen on mobile mode 
       mobile_sticky_header_height : 100,  //-- Value in milliseconds. This option is used to change the sticky header animation effect speed on mobile mode 
       /* MEDIA QUERY WIDTH */ 
       media_query_max_width   : 768  //-- This is media query max width in px unit. Which is Used for mobile screen. Don't change if you don't know about media query 
      }); 

JSモバイル

MY JS

$(window).load(function(){ 
     if (!$(".hotel-search-box").length) { 
    return false; //Check if the element exist 
    } 
    $(window).scroll(function() { 
    if($(window).scrollTop() > $(".hotel-search-box").offset().top+$(".hotel-search-box").height()){ 
      $(".sticky-checkin").fadeIn(500); 
     }else{ 
      $(".sticky-checkin").fadeOut(500); 
     } 
    }); 
}) 

MASHプラグインでは動作しません。 click to demo address

編集:レスポンシブでチェックアウトした場合(< 768px)ページをスクロールしても何も起こりませんが、ページを更新してスクロールすると効果があることがわかります。

答えて

1

この問題は、ブラウザのサイズを変更した場合にのみ表示されます。 < 768pxでページを開くと正常に動作します。 onresizeイベントにはいくつか問題があります。

+0

本当ですか?開いているページを768px未満のページをリフレッシュせずにスクロールしてください。固定メニューが表示される場合はページをスクロールしてください。そうですが、私にとっては何も起こっていません:) –

+1

もう一度チェックしました。 <768px上で直接ページを開くと、スクロールするときに上ボタンと固定メニューが機能します。何が起こっていないのですか? –

+0

私のデックストップとモバイルadnに何も起こりません私はオレンジ色の固定棒について話していますか?モバイル更新ページの –

関連する問題