2017-01-05 6 views
-1

この要素(ナビゲーションバー)をフッターで停止させる必要があります。私はjQueryをコード化するのが面倒だったので、トップがそれに合ったときに動くようにしましたが、フッタに達すると停止させることはできません。私はプレーンなJavascriptと異なるjQueryで試しましたが、このコードだけが動作します。ありがとう!あなたのjqueryので固定ナ바バーをフッターで停止させる

var scrolljsTop = $('#scrolljs').offset().top; 
 
$(window).scroll(function() { 
 
    var currentScroll = $(window).scrollTop(); 
 
    if (currentScroll >= scrolljsTop) { 
 
    $('#scrolljs').css({ 
 
     position: 'fixed', 
 
     top: '0' 
 
    }); 
 
    } else { 
 
    $('#scrolljs').css({ 
 
     position: 'relative' 
 
    }); 
 
    } 
 
});
#cssmenu { 
 
    padding: 0; 
 
    margin: 0; 
 
    margin-top: 10px; 
 
    border: 0; 
 
    line-height: 1; 
 
    height: 1560px; 
 
    box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.2), 0 12px 26px 0 rgba(0, 0, 0, 0.19); 
 
} 
 
#cssmenu ul, 
 
#cssmenu ul li, 
 
#cssmenu ul ul { 
 
    list-style: none; 
 
    margin: 0; 
 
    padding: 0; 
 
} 
 
#cssmenu ul { 
 
    position: relative; 
 
    z-index: 597; 
 
    float: left; 
 
} 
 
#cssmenu ul li { 
 
    float: left; 
 
    min-height: 1px; 
 
    line-height: 1em; 
 
    vertical-align: middle; 
 
    position: relative; 
 
} 
 
#cssmenu ul li.hover, 
 
#cssmenu ul li:hover { 
 
    position: relative; 
 
    z-index: 599; 
 
    cursor: default; 
 
} 
 
#cssmenu ul ul { 
 
    visibility: hidden; 
 
    position: absolute; 
 
    top: 100%; 
 
    left: 0px; 
 
    z-index: 598; 
 
    width: 100%; 
 
} 
 
#cssmenu ul ul li { 
 
    float: none; 
 
} 
 
#cssmenu ul ul ul { 
 
    top: -2px; 
 
    right: 0; 
 
} 
 
#cssmenu ul li:hover > ul { 
 
    visibility: visible; 
 
} 
 
#cssmenu ul ul { 
 
    top: 1px; 
 
    left: 99%; 
 
} 
 
#cssmenu ul li { 
 
    float: none; 
 
} 
 
#cssmenu ul ul { 
 
    margin-top: 1px; 
 
} 
 
#cssmenu ul ul li { 
 
    font-weight: normal; 
 
} 
 
/* Custom CSS Styles */ 
 

 
#cssmenu { 
 
    width: 200px; 
 
    background: #333; 
 
    font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif; 
 
    font-size: 12px; 
 
    zoom: 1; 
 
    border-right: 3px solid #1b9bff; 
 
    color: #fff; 
 
} 
 
#cssmenu:before { 
 
    content: ''; 
 
    display: block; 
 
} 
 
#cssmenu:after { 
 
    content: ''; 
 
    display: table; 
 
    clear: both; 
 
} 
 
#cssmenu a { 
 
    display: block; 
 
    padding: 15px 20px; 
 
    color: #fff; 
 
    text-decoration: none; 
 
    text-transform: uppercase; 
 
} 
 
#cssmenu > ul { 
 
    width: 200px; 
 
} 
 
#cssmenu ul ul { 
 
    width: 200px; 
 
} 
 
#cssmenu > ul > li > a { 
 
    border-right: 3px solid #1b9bff; 
 
    color: #fff; 
 
} 
 
#cssmenu > ul > li > a:hover { 
 
    color: #fff; 
 
} 
 
#cssmenu > ul > li.active a { 
 
    background: #1b9bff; 
 
} 
 
#cssmenu > ul > li a:hover, 
 
#cssmenu > ul > li:hover a { 
 
    background: #006fc5; 
 
} 
 
#cssmenu li { 
 
    position: relative; 
 
} 
 
#cssmenu ul li.has-sub > a:after { 
 
    content: '+'; 
 
    position: absolute; 
 
    top: 50%; 
 
    right: 15px; 
 
    margin-top: -6px; 
 
} 
 
#cssmenu ul ul li.first { 
 
    -webkit-border-radius: 0 3px 0 0; 
 
    -moz-border-radius: 0 3px 0 0; 
 
    border-radius: 0 3px 0 0; 
 
} 
 
#cssmenu ul ul li.last { 
 
    -webkit-border-radius: 0 0 3px 0; 
 
    -moz-border-radius: 0 0 3px 0; 
 
    border-radius: 0 0 3px 0; 
 
    border-bottom: 0; 
 
} 
 
#cssmenu ul ul { 
 
    -webkit-border-radius: 0 3px 3px 0; 
 
    -moz-border-radius: 0 3px 3px 0; 
 
    border-radius: 0 3px 3px 0; 
 
} 
 
#cssmenu ul ul { 
 
    border: 1px solid #0082e7; 
 
} 
 
#cssmenu ul ul a { 
 
    font-size: 12px; 
 
    color: #fff; 
 
} 
 
#cssmenu ul ul a:hover { 
 
    color: #fff; 
 
} 
 
#cssmenu ul ul li { 
 
    border-bottom: 1px solid #0082e7; 
 
} 
 
#cssmenu ul ul li:hover > a { 
 
    background: #4eb1ff; 
 
    color: #fff; 
 
} 
 
#cssmenu.align-right > ul > li > a { 
 
    border-left: 4px solid #1b9bff; 
 
    border-right: none; 
 
} 
 
#cssmenu.align-right { 
 
    float: right; 
 
} 
 
#cssmenu.align-right li { 
 
    text-align: right; 
 
} 
 
#cssmenu.align-right ul li.has-sub > a:before { 
 
    content: '+'; 
 
    position: absolute; 
 
    top: 50%; 
 
    left: 15px; 
 
    margin-top: -6px; 
 
} 
 
#cssmenu.align-right ul li.has-sub > a:after { 
 
    content: none; 
 
} 
 
#cssmenu.align-right ul ul { 
 
    visibility: hidden; 
 
    position: absolute; 
 
    top: 0; 
 
    left: -100%; 
 
    z-index: 598; 
 
    width: 100%; 
 
} 
 
#cssmenu.align-right ul ul li.first { 
 
    -webkit-border-radius: 3px 0 0 0; 
 
    -moz-border-radius: 3px 0 0 0; 
 
    border-radius: 3px 0 0 0; 
 
} 
 
#cssmenu.align-right ul ul li.last { 
 
    -webkit-border-radius: 0 0 0 3px; 
 
    -moz-border-radius: 0 0 0 3px; 
 
    border-radius: 0 0 0 3px; 
 
} 
 
#cssmenu.align-right ul ul { 
 
    -webkit-border-radius: 3px 0 0 3px; 
 
    -moz-border-radius: 3px 0 0 3px; 
 
    border-radius: 3px 0 0 3px; 
 
} 
 
#footer { 
 
    height:500px; 
 
    background-color:#2f3a5f 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div> 
 
<div id="cssmenu"> 
 
    <ul id="scrolljs"> 
 
    <li class="active" id="social-float"> 
 
     <a href="#" target="_blank">Home</a> 
 
    </li> 
 
    <li><a href="#">Menus</a> 
 
    </li> 
 
    <li><a href="#">Settings</a> 
 
    </li> 
 
    <li><a href="#">Contact</a> 
 
    </li> 
 
    </ul> 
 
</div> 
 
</div> 
 
<div id="footer"></div>

+0

なぜそれが高さが1560pxのですか? –

+0

私のウェブページに長いCSSのメニューが必要 –

答えて

0

あなたposition: fixedposition: absoluteにを変更するので、それは次のようになります。

var scrolljsTop = $('#scrolljs').offset().top; 
$(window).scroll(function() { 
    var currentScroll = $(window).scrollTop(); 
    if (currentScroll >= scrolljsTop) { 
    $('#scrolljs').css({ 
     position: 'absolute', 
     top: '0' 
    }); 
    } else { 
    $('#scrolljs').css({ 
     position: 'relative' 
    }); 
    } 
}); 

http://codepen.io/kawnah/pen/EZaeYg

、あなたのメニューので、それほど大きさであることに注意してくださいユーザーがスクロールしていくうちに停止するでしょう。

0

スクロールの内側に、

//Get the differnce of the two divs height here 
var def_height = $('#content').height() - $('#scrolljs').height(); 

今すぐあなたのjQueryの

contentのdivの高さとcsmenu divの間の差を取得するにはidを持つdiv要素にcontent

<div id='content'> 
    <div id="cssmenu"> 
    <ul id="scrolljs"> 
    <li class="active" id="social-float"> 
     <a href="#" target="_blank">Home</a> 
    </li> 
    <li><a href="#">Menus</a> 
    </li> 
    <li><a href="#">Settings</a> 
    </li> 
    <li><a href="#">Contact</a> 
    </li> 
    </ul> 
</div> 
</div> 

をごcssmenuラップjQueryのイベントリスナーは、最大をdef_heightの計算に設定しました上にlated。ここで

/* 
    Set max top scroll to the def_height 
*/ 
var scroll = (currentScroll<def_height)?currentScroll:def_height; 

$('#scrolljs').css('top',scroll + 'px'); 

フル更新jQueryの

var scrolljsTop = $('#scrolljs').offset().top; 

//Get the differnce of the two divs height here 
var def_height = $('#content').height() - $('#scrolljs').height(); 

$(window).scroll(function() { 

    var currentScroll = $(window).scrollTop(); 

    if (currentScroll >= scrolljsTop) { 
    /* 
     Set max top scroll to the def_height 
    */ 
    var scroll = (currentScroll<def_height)?currentScroll:def_height; 

    $('#scrolljs').css('top',scroll + 'px'); 
    } else { 
    $('#scrolljs').css('top','0'); 
    } 
}); 

ここでは、あなたはフッターオフセット必要と現在のスクロールに追加する必要のある更新スニペット

var scrolljsTop = $('#scrolljs').offset().top; 
 

 
//Get the differnce of the two divs height here 
 
var def_height = $('#content').height() - $('#scrolljs').height(); 
 

 
$(window).scroll(function() { 
 
    var currentScroll = $(window).scrollTop(); 
 
    if (currentScroll >= scrolljsTop) { 
 
    /* 
 
     Set max top scroll to the def_height 
 
    */ 
 
    var scroll = (currentScroll<def_height)?currentScroll:def_height; 
 
    
 
    $('#scrolljs').css('top',scroll + 'px'); 
 
    } else { 
 
    $('#scrolljs').css('top','0'); 
 
    } 
 
});
#cssmenu { 
 
    padding: 0; 
 
    margin: 0; 
 
    margin-top: 10px; 
 
    border: 0; 
 
    line-height: 1; 
 
    height: 1560px; 
 
    box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.2), 0 12px 26px 0 rgba(0, 0, 0, 0.19); 
 
} 
 
#cssmenu ul, 
 
#cssmenu ul li, 
 
#cssmenu ul ul { 
 
    list-style: none; 
 
    margin: 0; 
 
    padding: 0; 
 
} 
 
#cssmenu ul { 
 
    position: relative; 
 
    z-index: 597; 
 
    float: left; 
 
} 
 
#cssmenu ul li { 
 
    float: left; 
 
    min-height: 1px; 
 
    line-height: 1em; 
 
    vertical-align: middle; 
 
    position: relative; 
 
} 
 
#cssmenu ul li.hover, 
 
#cssmenu ul li:hover { 
 
    position: relative; 
 
    z-index: 599; 
 
    cursor: default; 
 
} 
 
#cssmenu ul ul { 
 
    visibility: hidden; 
 
    position: absolute; 
 
    top: 100%; 
 
    left: 0px; 
 
    z-index: 598; 
 
    width: 100%; 
 
} 
 
#cssmenu ul ul li { 
 
    float: none; 
 
} 
 
#cssmenu ul ul ul { 
 
    top: -2px; 
 
    right: 0; 
 
} 
 
#cssmenu ul li:hover > ul { 
 
    visibility: visible; 
 
} 
 
#cssmenu ul ul { 
 
    top: 1px; 
 
    left: 99%; 
 
} 
 
#cssmenu ul li { 
 
    float: none; 
 
} 
 
#cssmenu ul ul { 
 
    margin-top: 1px; 
 
} 
 
#cssmenu ul ul li { 
 
    font-weight: normal; 
 
} 
 
/* Custom CSS Styles */ 
 

 
#cssmenu { 
 
    width: 200px; 
 
    background: #333; 
 
    font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif; 
 
    font-size: 12px; 
 
    zoom: 1; 
 
    border-right: 3px solid #1b9bff; 
 
    color: #fff; 
 
} 
 
#cssmenu:before { 
 
    content: ''; 
 
    display: block; 
 
} 
 
#cssmenu:after { 
 
    content: ''; 
 
    display: table; 
 
    clear: both; 
 
} 
 
#cssmenu a { 
 
    display: block; 
 
    padding: 15px 20px; 
 
    color: #fff; 
 
    text-decoration: none; 
 
    text-transform: uppercase; 
 
} 
 
#cssmenu > ul { 
 
    width: 200px; 
 
} 
 
#cssmenu ul ul { 
 
    width: 200px; 
 
} 
 
#cssmenu > ul > li > a { 
 
    border-right: 3px solid #1b9bff; 
 
    color: #fff; 
 
} 
 
#cssmenu > ul > li > a:hover { 
 
    color: #fff; 
 
} 
 
#cssmenu > ul > li.active a { 
 
    background: #1b9bff; 
 
} 
 
#cssmenu > ul > li a:hover, 
 
#cssmenu > ul > li:hover a { 
 
    background: #006fc5; 
 
} 
 
#cssmenu li { 
 
    position: relative; 
 
} 
 
#cssmenu ul li.has-sub > a:after { 
 
    content: '+'; 
 
    position: absolute; 
 
    top: 50%; 
 
    right: 15px; 
 
    margin-top: -6px; 
 
} 
 
#cssmenu ul ul li.first { 
 
    -webkit-border-radius: 0 3px 0 0; 
 
    -moz-border-radius: 0 3px 0 0; 
 
    border-radius: 0 3px 0 0; 
 
} 
 
#cssmenu ul ul li.last { 
 
    -webkit-border-radius: 0 0 3px 0; 
 
    -moz-border-radius: 0 0 3px 0; 
 
    border-radius: 0 0 3px 0; 
 
    border-bottom: 0; 
 
} 
 
#cssmenu ul ul { 
 
    -webkit-border-radius: 0 3px 3px 0; 
 
    -moz-border-radius: 0 3px 3px 0; 
 
    border-radius: 0 3px 3px 0; 
 
} 
 
#cssmenu ul ul { 
 
    border: 1px solid #0082e7; 
 
} 
 
#cssmenu ul ul a { 
 
    font-size: 12px; 
 
    color: #fff; 
 
} 
 
#cssmenu ul ul a:hover { 
 
    color: #fff; 
 
} 
 
#cssmenu ul ul li { 
 
    border-bottom: 1px solid #0082e7; 
 
} 
 
#cssmenu ul ul li:hover > a { 
 
    background: #4eb1ff; 
 
    color: #fff; 
 
} 
 
#cssmenu.align-right > ul > li > a { 
 
    border-left: 4px solid #1b9bff; 
 
    border-right: none; 
 
} 
 
#cssmenu.align-right { 
 
    float: right; 
 
} 
 
#cssmenu.align-right li { 
 
    text-align: right; 
 
} 
 
#cssmenu.align-right ul li.has-sub > a:before { 
 
    content: '+'; 
 
    position: absolute; 
 
    top: 50%; 
 
    left: 15px; 
 
    margin-top: -6px; 
 
} 
 
#cssmenu.align-right ul li.has-sub > a:after { 
 
    content: none; 
 
} 
 
#cssmenu.align-right ul ul { 
 
    visibility: hidden; 
 
    position: absolute; 
 
    top: 0; 
 
    left: -100%; 
 
    z-index: 598; 
 
    width: 100%; 
 
} 
 
#cssmenu.align-right ul ul li.first { 
 
    -webkit-border-radius: 3px 0 0 0; 
 
    -moz-border-radius: 3px 0 0 0; 
 
    border-radius: 3px 0 0 0; 
 
} 
 
#cssmenu.align-right ul ul li.last { 
 
    -webkit-border-radius: 0 0 0 3px; 
 
    -moz-border-radius: 0 0 0 3px; 
 
    border-radius: 0 0 0 3px; 
 
} 
 
#cssmenu.align-right ul ul { 
 
    -webkit-border-radius: 3px 0 0 3px; 
 
    -moz-border-radius: 3px 0 0 3px; 
 
    border-radius: 3px 0 0 3px; 
 
} 
 
#footer { 
 
    height:500px; 
 
    background-color:#2f3a5f 
 
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> 
 
<div id="content"> 
 
<div id="cssmenu"> 
 
    <ul id="scrolljs"> 
 
    <li class="active" id="social-float"> 
 
     <a href="#" target="_blank">Home</a> 
 
    </li> 
 
    <li><a href="#">Menus</a> 
 
    </li> 
 
    <li><a href="#">Settings</a> 
 
    </li> 
 
    <li><a href="#">Contact</a> 
 
    </li> 
 
    </ul> 
 
</div> 
 
</div> 
 
<div id="footer"></div>

+0

私はこれらのことを学んでいるので、私はたくさんのxDを求めるかもしれません。 2つのdivの違いとdef_heightはどうすればわかりますか? –

+0

コードのコメントで述べたように、def_heightは2つの高さの差を格納します。 –

+0

2つのdivの違いを調べるには、jQuery '$( 'your_div_selector')。height()を使用して2つのdivの高さを取得し、最後に両方の高さを引いただけです –

0

ですwindowinnerHeight。これがあなたにはっきりと役立つことを願っていますコメントがあれば質問してください。 :)。 FiddleLiveDemo


 
$(window).scroll(function() { 
 
var scrollHeight= ($('#scrolljs').offset().top + $('#scrolljs').height()); 
 
var currentScroll = ($(document).scrollTop() + window.innerHeight); 
 
var footerOffset = $('#footer').offset().top; 
 

 
if (scrollHeight >= footerOffset){ 
 
    $('#scrolljs').css('position', 'absolute'); 
 
    } 
 
    else if (currentScroll < footerOffset){ 
 
    $('#scrolljs').css('position', 'fixed'); // restore when you scroll up 
 
} 
 
});
#cssmenu { 
 
    padding: 0; 
 
    margin: 0; 
 
    margin-top: 10px; 
 
    border: 0; 
 
    line-height: 1; 
 
    height: 1560px; 
 
    box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.2), 0 12px 26px 0 rgba(0, 0, 0, 0.19); 
 
} 
 
#cssmenu ul, 
 
#cssmenu ul li, 
 
#cssmenu ul ul { 
 
    list-style: none; 
 
    margin: 0; 
 
    padding: 0; 
 
} 
 
#cssmenu ul { 
 
    position: relative; 
 
    z-index: 597; 
 
    float: left; 
 
} 
 
#cssmenu ul li { 
 
    float: left; 
 
    min-height: 1px; 
 
    line-height: 1em; 
 
    vertical-align: middle; 
 
    position: relative; 
 
} 
 
#cssmenu ul li.hover, 
 
#cssmenu ul li:hover { 
 
    position: relative; 
 
    z-index: 599; 
 
    cursor: default; 
 
} 
 
#cssmenu ul ul { 
 
    visibility: hidden; 
 
    position: absolute; 
 
    top: 100%; 
 
    left: 0px; 
 
    z-index: 598; 
 
    width: 100%; 
 
} 
 
#cssmenu ul ul li { 
 
    float: none; 
 
} 
 
#cssmenu ul ul ul { 
 
    top: -2px; 
 
    right: 0; 
 
} 
 
#cssmenu ul li:hover > ul { 
 
    visibility: visible; 
 
} 
 
#cssmenu ul ul { 
 
    top: 1px; 
 
    left: 99%; 
 
} 
 
#cssmenu ul li { 
 
    float: none; 
 
} 
 
#cssmenu ul ul { 
 
    margin-top: 1px; 
 
} 
 
#cssmenu ul ul li { 
 
    font-weight: normal; 
 
} 
 
/* Custom CSS Styles */ 
 

 
#cssmenu { 
 
    width: 200px; 
 
    background: #333; 
 
    font-family: 'Oxygen Mono', Tahoma, Arial, sans-serif; 
 
    font-size: 12px; 
 
    zoom: 1; 
 
    border-right: 3px solid #1b9bff; 
 
    color: #fff; 
 
} 
 
#cssmenu:before { 
 
    content: ''; 
 
    display: block; 
 
} 
 
#cssmenu:after { 
 
    content: ''; 
 
    display: table; 
 
    clear: both; 
 
} 
 
#cssmenu a { 
 
    display: block; 
 
    padding: 15px 20px; 
 
    color: #fff; 
 
    text-decoration: none; 
 
    text-transform: uppercase; 
 
} 
 
#cssmenu > ul { 
 
    width: 200px; 
 
} 
 
#cssmenu ul ul { 
 
    width: 200px; 
 
} 
 
#cssmenu > ul > li > a { 
 
    border-right: 3px solid #1b9bff; 
 
    color: #fff; 
 
} 
 
#cssmenu > ul > li > a:hover { 
 
    color: #fff; 
 
} 
 
#cssmenu > ul > li.active a { 
 
    background: #1b9bff; 
 
} 
 
#cssmenu > ul > li a:hover, 
 
#cssmenu > ul > li:hover a { 
 
    background: #006fc5; 
 
} 
 
#cssmenu li { 
 
    position: relative; 
 
} 
 
#cssmenu ul li.has-sub > a:after { 
 
    content: '+'; 
 
    position: absolute; 
 
    top: 50%; 
 
    right: 15px; 
 
    margin-top: -6px; 
 
} 
 
#cssmenu ul ul li.first { 
 
    -webkit-border-radius: 0 3px 0 0; 
 
    -moz-border-radius: 0 3px 0 0; 
 
    border-radius: 0 3px 0 0; 
 
} 
 
#cssmenu ul ul li.last { 
 
    -webkit-border-radius: 0 0 3px 0; 
 
    -moz-border-radius: 0 0 3px 0; 
 
    border-radius: 0 0 3px 0; 
 
    border-bottom: 0; 
 
} 
 
#cssmenu ul ul { 
 
    -webkit-border-radius: 0 3px 3px 0; 
 
    -moz-border-radius: 0 3px 3px 0; 
 
    border-radius: 0 3px 3px 0; 
 
} 
 
#cssmenu ul ul { 
 
    border: 1px solid #0082e7; 
 
} 
 
#cssmenu ul ul a { 
 
    font-size: 12px; 
 
    color: #fff; 
 
} 
 
#cssmenu ul ul a:hover { 
 
    color: #fff; 
 
} 
 
#cssmenu ul ul li { 
 
    border-bottom: 1px solid #0082e7; 
 
} 
 
#cssmenu ul ul li:hover > a { 
 
    background: #4eb1ff; 
 
    color: #fff; 
 
} 
 
#cssmenu.align-right > ul > li > a { 
 
    border-left: 4px solid #1b9bff; 
 
    border-right: none; 
 
} 
 
#cssmenu.align-right { 
 
    float: right; 
 
} 
 
#cssmenu.align-right li { 
 
    text-align: right; 
 
} 
 
#cssmenu.align-right ul li.has-sub > a:before { 
 
    content: '+'; 
 
    position: absolute; 
 
    top: 50%; 
 
    left: 15px; 
 
    margin-top: -6px; 
 
} 
 
#cssmenu.align-right ul li.has-sub > a:after { 
 
    content: none; 
 
} 
 
#cssmenu.align-right ul ul { 
 
    visibility: hidden; 
 
    position: absolute; 
 
    top: 0; 
 
    left: -100%; 
 
    z-index: 598; 
 
    width: 100%; 
 
} 
 
#cssmenu.align-right ul ul li.first { 
 
    -webkit-border-radius: 3px 0 0 0; 
 
    -moz-border-radius: 3px 0 0 0; 
 
    border-radius: 3px 0 0 0; 
 
} 
 
#cssmenu.align-right ul ul li.last { 
 
    -webkit-border-radius: 0 0 0 3px; 
 
    -moz-border-radius: 0 0 0 3px; 
 
    border-radius: 0 0 0 3px; 
 
} 
 
#cssmenu.align-right ul ul { 
 
    -webkit-border-radius: 3px 0 0 3px; 
 
    -moz-border-radius: 3px 0 0 3px; 
 
    border-radius: 3px 0 0 3px; 
 
} 
 
#footer { 
 
    height:500px; 
 
    background-color:#2f3a5f 
 
}
<script src="https://code.jquery.com/jquery-3.1.0.min.js"></script> 
 
<div> 
 
<div id="cssmenu"> 
 
    <ul id="scrolljs"> 
 
    <li class="active" id="social-float"> 
 
     <a href="#" target="_blank">Home</a> 
 
    </li> 
 
    <li><a href="#">Menus</a> 
 
    </li> 
 
    <li><a href="#">Settings</a> 
 
    </li> 
 
    <li><a href="#">Contact</a> 
 
    </li> 
 
    </ul> 
 
</div> 
 
</div> 
 
<div id="footer"></div>

関連する問題