素材牛VIP会员

基于swiper的响应式移动端tab切换效果

 所属分类:网页特效-选项卡/滑动门

 浏览:11936次  评论:1次  更新时间:2016-12-05
牛币素材VIP可免积分下载
基于swiper的响应式移动端tab切换效果兼容IE8
积分说明:注册即送10牛币,每日签到可获得5牛币,成为VIP会员可永久免牛币下载!   充值积分   充值会员   更多说明»
素材描述:是一款基于swiper的插件,拨动框架已写好,只需根据需要更改样式即可。

详细介绍

使用方法:

引入CSS样式

<link href="images/font/font-awesome.css" rel="stylesheet" type="text/css"><!--字体图标-->
<link href="css/public.css" rel="stylesheet" type="text/css"><!--默认共用样式-->
<link rel="stylesheet" href="swiper/swiper.min.css">
<link href="css/page_style.css" rel="stylesheet" type="text/css"><!--页面所需样式-->
/* 用户绑定拨动框架 */
.my-pagination .swiper-pagination-bullet { text-align: center; border-radius: 0; opacity: 1; }
.my-pagination ul { display: -webkit-box; }
.my-pagination li { display: block; background: #fff; overflow: hidden; box-flex: 1; -moz-box-flex: 1; -webkit-box-flex: 1; height: 40px; line-height: 40px; position: relative; font-size: 15px; }
.my-pagination li:after { position: absolute; top: auto; right: auto; bottom: 0; left: 0; z-index: 1; display: block; width: 100%; height: 1px; content: ''; background-color: #dcdcdc; -webkit-transform-origin: 50% 100%; transform-origin: 50% 100%; -webkit-transform: scaleY(.5) }
.my-pagination .swiper-pagination-bullet-active { color: #21a4f4; }
.my-pagination .swiper-pagination-bullet-active:after { opacity: 1; background-color: #21a4f4; height: 4px; }
/* 用户绑定 */
.user_zc_body { margin: 0px auto; overflow: hidden; background: #fff; }
.user_zc_body ul { margin: 0 20px; overflow: hidden; }
.user_zc_body li { background: #fff; overflow: hidden; padding: 10px 0; position: relative; }
.user_zc_body li:last-child { margin-bottom: 0; }
.user_zc_body li:after { content: ""; display: block; position: absolute; left: 0; bottom: 0; z-index: 1; width: 100%; height: 1px; background: #dcdcdc; -webkit-transform: scaleY(.5); }
.user_zc_body .p_input { padding-left: 40px; position: relative; }
.user_zc_body .p_input input { width: 100%; padding: 0; margin: 0; height: 40px; color: #444; font-size: 15px; }
.user_zc_body .p_input em { position: absolute; left: 0; top: 0; z-index: 1; width: 40px; height: 40px; line-height: 40px; text-align: center; color: #6ecb09; font-size: 16px; }
.user_zc_body .p_wjmm { margin: 20px; text-align: right; }
.user_zc_body .p_input_sm { padding-right: 50px; }
.user_zc_body .p_input_sm .sp_btn { display: inline-block; position: absolute; right: 5px; top: 5px; z-index: 1; width: 40px; height: 30px; line-height: 30px; text-align: center; background: #f4f4f4; color: #666; border-radius: 4px; font-size: 12px; }
.user_zc_body .p_input_sm .sp_btn i { font-size: 24px; margin-top: 4px; line-height: 32px; }
.user_zc_body .p_input_yzm { padding-right: 90px; }
.user_zc_body .p_input_yzm .sp_btn { display: inline-block; position: absolute; right: 5px; top: 5px; z-index: 1; width: 80px; height: 30px; line-height: 30px; text-align: center; background: #288eff; color: #fff; border-radius: 4px; font-size: 12px; }
.user_zc_body .p_input_yzm .sp_btn:active { background: #2686ef; }
.user_zc_body .p_input_yzm .sp_btn_dx { right: 70px; }
.user_zc_body .p_input_yzm .sp_btn.no_hit { color: #bbb; }
.user_wj_pw { overflow: hidden; padding: 0 10px; }
.user_zc_btn { padding: 20px; overflow: hidden; background: #fff; }
.user_zc_btn .p_btn { overflow: hidden; }
.user_zc_btn .p_btn a { display: block; height: 40px; line-height: 40px; text-align: center; color: #fff; border-radius: 4px; font-size: 16px; }
.user_zc_btn .p_btn a.c_1 { background: #f15145; }
.user_zc_btn .p_btn a.c_1:active { background: #e44d41; }
.user_zc_btn .p_btn a.c_2 { background: #00cfbe; }
.user_zc_btn .p_btn a.c_2:active { background: #00c3b3; }
.user_zc_btn .p_btn a.c_3 { background: #288eff; }
.user_zc_btn .p_btn a.c_3:active { background: #2686ef; }
.user_zc_btn .p_btn a.c_4 { background: #6ecb09; }
.user_zc_btn .p_btn a.c_4:active { background: #66bc08; }

引入jQuery库文件、JS文件

<script src="http://www.sucainiu.com/themes/cdn/jquery/jquery-1.10.2.js"></script>
<script src="swiper/swiper.min.js"></script>

初始化、参数配置

var mySwiper = new Swiper('.swiper-container',{
pagination: '.my-pagination-ul',
paginationClickable: true,
paginationBulletRender: function (index, className) {
switch (index) {
  case 0: name='手机';break;
  case 1: name='固话';break;
  case 2: name='你好';break;
  case 3: name='我好';break;
  default: name='';
}
      return '<li class="' + className + '">' + name + '</li>';
  }
})

HTML结构

<div class="swiper-container">
	<div class="my-pagination"><ul class="my-pagination-ul"></ul></div>
	<div class="swiper-wrapper">
    	
		<div class="swiper-slide">
        	<!--手机绑定GO-->
        	<div class="user_zc_body">
                <ul>
                    
                    <li>
                        <p class="p_input"><em class="fa fa-tablet" style="font-size:18px;"></em><input type="tel" placeholder="请输入手机号"></p>
                    </li>
                    <li>
                        <p class="p_input p_input_yzm"><em class="fa  fa-envelope" style="font-size:14px;"></em><input type="text" placeholder="请输入验证码"><span class="sp_btn">获取验证码</span></p>
                    </li>
                    
                </ul>
            </div>
            <div class="user_zc_btn"><p class="p_btn"><a href="#" class="c_4">立即绑定</a></p></div>
            
            <!--手机绑定END-->
            
        </div>
        
        
		<div class="swiper-slide">
        
        	<!--固话绑定GO-->
        	<div class="user_zc_body">
                <ul>
                    
                    <li>
                        <p class="p_input"><em class="fa fa-user" style=""></em><input type="text" placeholder="客户号 / 开户人姓名"></p>
                    </li>
                    <li>
                        <p class="p_input "><em class="fa fa-lock"></em><input type="text" placeholder="服务密码 / 开户人身份证号"></p>
                    </li>
                    
                </ul>
            </div>
            <div class="user_zc_btn"><p class="p_btn"><a href="#" class="c_4">立即绑定</a></p></div>
            
            <!--固话绑定END-->
        
        </div>
        <div class="swiper-slide">
        
            <!--固话绑定GO-->
            <div class="user_zc_body">
                <ul>
                    
                    <li>
                        <p class="p_input"><em class="fa fa-user" style=""></em><input type="text" placeholder="客户号 / 开户人姓名"></p>
                    </li>
                    <li>
                        <p class="p_input "><em class="fa fa-lock"></em><input type="text" placeholder="服务密码 / 开户人身份证号"></p>
                    </li>
                    
                </ul>
            </div>
            <div class="user_zc_btn"><p class="p_btn"><a href="#" class="c_4">立即绑定</a></p></div>
            
            <!--固话绑定END-->
        
        </div>
        <div class="swiper-slide">
        
            <!--固话绑定GO-->
            <div class="user_zc_body">
                <ul>
                    
                    <li>
                        <p class="p_input"><em class="fa fa-user" style=""></em><input type="text" placeholder="客户号 / 开户人姓名"></p>
                    </li>
                    <li>
                        <p class="p_input "><em class="fa fa-lock"></em><input type="text" placeholder="服务密码 / 开户人身份证号"></p>
                    </li>
                    
                </ul>
            </div>
            <div class="user_zc_btn"><p class="p_btn"><a href="#" class="c_4">立即绑定</a></p></div>
            
            <!--固话绑定END-->
        
        </div>
	</div>
</div>

相关素材 - 选项卡/滑动门

讨论这个素材(1)回答他人问题或分享使用心得会奖励牛币

qq***03  
2021年04月09日

很好

回复
 文明上网,理性发言!   😉 阿里云幸运券,戳我领取
我的牛币余额:0
所需牛币:1 开始下载

牛币获取:签到、评论、充值    » 在线充值(10牛币=1元)