首页 技术 正文
技术 2022年11月7日
0 收藏 407 点赞 413 浏览 2337 个字

分享一款效果非常炫酷的谷歌 Material Design 风格jQuery和CSS3滑动选项卡特效。该选项卡特效集合了扁平风格设计和按钮点击波特效。是一款设计的非常不错的Material Design 风格作品。效果图如下:

基于jQuery和CSS3超酷Material Design风格滑动菜单导航特效

在线预览   源码下载

实现的代码。

hmtl代码:

 <div class="htmleaf-container">
<br />
<br />
<br />
<div class="htmleaf-content bgcolor-3">
<ul>
<li>Tab One</li>
<li>Tab Two</li>
<li>Tab Three</li>
<li class="slider"></li>
</ul>
</div>
<script src="/scripts/2bc/_gg_980_90.js" type="text/javascript"></script>
</div>
<script src="http://libs.useso.com/js/jquery/1.11.0/jquery.min.js"></script>
<script>
$("ul li").click(function (e) { // make sure we cannot click the slider
if ($(this).hasClass('slider')) {
return;
} /* Add the slider movement */ // what tab was pressed
var whatTab = $(this).index(); // Work out how far the slider needs to go
var howFar = 160 * whatTab; $(".slider").css({
left: howFar + "px"
}); /* Add the ripple */ // Remove olds ones
$(".ripple").remove(); // Setup
var posX = $(this).offset().left,
posY = $(this).offset().top,
buttonWidth = $(this).width(),
buttonHeight = $(this).height(); // Add the element
$(this).prepend("<span class='ripple'></span>"); // Make it round!
if (buttonWidth >= buttonHeight) {
buttonHeight = buttonWidth;
} else {
buttonWidth = buttonHeight;
} // Get the center of the element
var x = e.pageX - posX - buttonWidth / 2;
var y = e.pageY - posY - buttonHeight / 2; // Add the ripples CSS and start the animation
$(".ripple").css({
width: buttonWidth,
height: buttonHeight,
top: y + 'px',
left: x + 'px'
}).addClass("rippleEffect");
});
</script>

css代码:

body {
font-family: 'Raleway', sans-serif;
/*background: #2C3E50;*/
} ul {
font-size:;
position: relative;
padding:;
width: 480px;
margin: 40px auto;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
} li {
display: inline-block;
width: 160px;
height: 60px;
background: #DA4453;
font-size: 16px;
text-align: center;
line-height: 60px;
color: #fff;
text-transform: uppercase;
position: relative;
overflow: hidden;
cursor: pointer;
} .slider {
display: block;
position: absolute;
bottom:;
left:;
height: 4px;
background: #46CFB0;
-webkit-transition: all 0.5s;
transition: all 0.5s;
} /* Ripple */ .ripple {
width:;
height:;
border-radius: 50%;
background: rgba(255, 255, 255, 0.4);
-webkit-transform: scale(0);
-ms-transform: scale(0);
transform: scale(0);
position: absolute;
opacity:;
} .rippleEffect {
-webkit-animation: rippleDrop .6s linear;
animation: rippleDrop .6s linear;
}
@-webkit-keyframes
rippleDrop { 100% {
-webkit-transform: scale(2);
transform: scale(2);
opacity:;
}
}
@keyframes
rippleDrop { 100% {
-webkit-transform: scale(2);
transform: scale(2);
opacity:;
}
}

via:http://www.w2bc.com/Article/38841

相关推荐
python开发_常用的python模块及安装方法
adodb:我们领导推荐的数据库连接组件bsddb3:BerkeleyDB的连接组件Cheetah-1.0:我比较喜欢这个版本的cheeta…
日期:2022-11-24 点赞:878 阅读:8,909
Educational Codeforces Round 11 C. Hard Process 二分
C. Hard Process题目连接:http://www.codeforces.com/contest/660/problem/CDes…
日期:2022-11-24 点赞:807 阅读:5,434
下载Ubuntn 17.04 内核源代码
zengkefu@server1:/usr/src$ uname -aLinux server1 4.10.0-19-generic #21…
日期:2022-11-24 点赞:569 阅读:6,249
可用Active Desktop Calendar V7.86 注册码序列号
可用Active Desktop Calendar V7.86 注册码序列号Name: www.greendown.cn Code: &nb…
日期:2022-11-24 点赞:733 阅读:6,060
Android调用系统相机、自定义相机、处理大图片
Android调用系统相机和自定义相机实例本博文主要是介绍了android上使用相机进行拍照并显示的两种方式,并且由于涉及到要把拍到的照片显…
日期:2022-11-24 点赞:512 阅读:7,692
Struts的使用
一、Struts2的获取  Struts的官方网站为:http://struts.apache.org/  下载完Struts2的jar包,…
日期:2022-11-24 点赞:671 阅读:4,730