小编给大家分享一下css实现酷炫的右侧悬浮菜单栏效果的方法,相信大部分人都还不怎么了解,因此分享这篇文章给大家参考一下,希望大家阅读完这篇文章后大有收获,下面让我们一起去了解一下吧!
默认显示效果:
鼠标悬浮效果:
HTML、JS代码如下:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title></title>
<script src="jquery-1.11.1.min.js"></script>
<style type="text/css">
*{margin:0;padding:0;}
body{ color:#333;font:12px/20px Arial,"Microsoft YaHei","宋体",sans-serif; text-align:center; background:#fff; }
a{text-decoration:none;color:#333;}
.rightNav{ position:fixed; width:140px; right:0; top:100px; _position:absolute; text-align:left; cursor:pointer; background-image:url(about:blank); }
.rightNav a{ display:block; position:relative; height:30px; line-height:30px; margin-bottom:2px; background:#fff; padding-right:10px; width:130px; overflow:hidden; cursor:pointer; right:-110px; }
.rightNav a:hover{ text-decoration:none; color:#39A4DC; }
.rightNav a:hover em{ background:#00b700}
.rightNav a em{ display:block; float:left; width:30px; background:#39A4DC; color:#fff; font-size:16px; text-align:center; margin-right:10px;}
.rightNav a.new em{ background:#f60;}
</style>
</head>
<body>
<div class="rightNav">
<a class="new" href="#effect0" style="right: -110px;"><em>0</em>综合/组合[new]</a>
<a href="#effect1" style="right: -110px;"><em>1</em>书签切换</a>
<a href="#effect2" style="right: -110px;"><em>2</em>幻灯片</a>
<a href="#effect3" style="right: -110px;"><em>3</em>带按钮切换</a>
<a class="new" href="#effect4" style="right: -110px;"><em>4</em>导航/菜单[new]</a>
<a class="new" href="#effect5" style="right: -110px;"><em>5</em>切换加载[new]</a>
<a href="#effectT1" style="right: -110px;"><em>6</em>其它效果</a>
<a href="#effectT1" style="right: -110px;"><em>7</em>特殊</a>
</div>
<script type="text/javascript">
//右侧导航
var btb=$(".rightNav");
var tempS;
$(".rightNav").hover(function(){
var thisObj = $(this);
tempS = setTimeout(function(){
thisObj.find("a").each(function(i){
var tA=$(this);
console.log(i);
setTimeout(function(){ tA.animate({right:"0"},200);},50*i);
});
},200);
},function(){
if(tempS){ clearTimeout(tempS); }
$(this).find("a").each(function(i){
var tA=$(this);
setTimeout(function(){ tA.animate({right:"-110"},200,function(){
});},50*i);
});
});
</script>
</body>
</html>
以上是css实现酷炫的右侧悬浮菜单栏效果的方法的所有内容,感谢各位的阅读!相信大家都有了一定的了解,希望分享的内容对大家有所帮助,如果还想学习更多知识,欢迎关注亿速云行业资讯频道!
亿速云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
免责声明:本站发布的内容(图片、视频和文字)以原创、转载和分享为主,文章观点不代表本网站立场,如果涉及侵权请联系站长邮箱:is@yisu.com进行举报,并提供相关证据,一经查实,将立刻删除涉嫌侵权内容。