jquery帶登錄注冊表單的寬屏圖片幻燈片切換代碼



114 454 152



特效描述:登錄注冊表單 寬屏圖片 幻燈片切換,

代碼結構

1. 引入CSS

<link href="css/style.css" rel="stylesheet" type="text/css" />

2. 引入JS

<script type="text/javascript" src="js/jquery-1.7.2.js"></script>

3. HTML代碼

<div class="wrap">
	<div class="banner-show" id="js_ban_content">
		<div class="cell bns-01">
			<div class="con">
			</div>
		</div>
		<div class="cell bns-02" style="display:none;">
			<div class="con">
				<a href="http://www.17sucai.com" target="_blank" class="banner-link">
				<i>圈子</i></a> </div>
		</div>
		<div class="cell bns-03" style="display:none;">
			<div class="con">
				<a href="http://www.17sucai.com" target="_blank" class="banner-link">
				<i>企業云</i></a> </div>
		</div>
	</div>
	<div class="banner-control" id="js_ban_button_box">
		<a href="javascript:;" class="left">左</a>
		<a href="javascript:;" class="right">右</a>
	</div>
<script type="text/javascript">
;(function(){
	var defaultInd = 0;
	var list = $('#js_ban_content').children();
	var count = 0;
	var change = function(newInd, callback){
		if(count) return;
		count = 2;
		$(list[defaultInd]).fadeOut(400, function(){
			count--;
			if(count <= 0){
				if(start.timer) window.clearTimeout(start.timer);
				callback && callback();
			}
		});
		$(list[newInd]).fadeIn(400, function(){
			defaultInd = newInd;
			count--;
			if(count <= 0){
				if(start.timer) window.clearTimeout(start.timer);
				callback && callback();
			}
		});
	}
	var next = function(callback){
		var newInd = defaultInd + 1;
		if(newInd >= list.length){
			newInd = 0;
		}
		change(newInd, callback);
	}
	var start = function(){
		if(start.timer) window.clearTimeout(start.timer);
		start.timer = window.setTimeout(function(){
			next(function(){
				start();
			});
		}, 8000);
	}
	start();
	$('#js_ban_button_box').on('click', 'a', function(){
		var btn = $(this);
		if(btn.hasClass('right')){
			//next
			next(function(){
				start();
			});
		}
		else{
			//prev
			var newInd = defaultInd - 1;
			if(newInd < 0){
				newInd = list.length - 1;
			}
			change(newInd, function(){
				start();
			});
		}
		return false;
	});
})();
</script>
<script type="text/javascript">
var FancyForm=function(){
	return{
		inputs:".reg-form input",
		setup:function(){
			var a=this;
			this.inputs=$(this.inputs);
			a.inputs.each(function(){
				var c=$(this);
				a.checkVal(c)
			});
			a.inputs.live("keyup blur",function(){
				var c=$(this);
				a.checkVal(c);
			});
		},checkVal:function(a){
			a.val().length>0?a.parent("div").addClass("val"):a.parent("div").removeClass("val")
		}
	}
}();
</script>
	<div class="container">
		<div class="register-box">
			<div class="reg-slogan">
				新用戶注冊</div>
			<div class="reg-form" id="js-form-mobile">
				<br>
				<br>
				<div class="cell">
					<label for="js-mobile_ipt">填寫手機號</label>
					<input type="text" name="mobile" id="js-mobile_ipt" class="text" maxlength="11" />
				</div>
				<div class="cell">
					<label for="js-mobile_pwd_ipt">設置密碼</label>
					<input type="password" name="passwd" id="js-mobile_pwd_ipt" class="text" />
					<input type="text" name="passwd" id="js-mobile_pwd_ipt_txt" class="text" maxlength="20" style="display:none;" />
					<b class="icon-form ifm-view js-view-pwd" title="查看密碼" style="display: none">
					查看密碼</b> </div>
				<!-- !短信驗證碼 -->
				<div class="cell vcode">
					<label for="js-mobile_vcode_ipt">輸入驗證碼</label>
					<input type="text" name="code" id="js-mobile_vcode_ipt" class="text" maxlength="6" />
					<a href="javascript:;" id="js-get_mobile_vcode" class="button btn-disabled">
					免費獲取驗證碼</a> </div>
				<div class="bottom">
					<a id="js-mobile_btn" href="javascript:;" class="button btn-green">
					立即注冊</a></div>
			</div>
			<div class="reg-form" id="js-form-mail" style="display: none;">
				<div class="cell">
					<label for="js-mail_ipt">輸入你的常用郵箱</label>
					<input type="text" name="email" id="js-mail_ipt" class="text" />
				</div>
				<div class="cell">
					<label for="js-mail_pwd_ipt">設置密碼</label>
					<input type="password" name="passwd" id="js-mail_pwd_ipt" class="text" />
					<input type="text" name="passwd" id="js-mail_pwd_ipt_txt" class="text" maxlength="20" style="display:none;" />
					<b class="icon-form ifm-view js-view-pwd" title="查看密碼" style="display: none">
					查看密碼</b> </div>
				<!-- !短信驗證碼 -->
				<div class="cell vcode">
					<label for="js-mail_vcode_ipt">輸入驗證碼</label>
					<input type="text" name="code" id="js-mail_vcode_ipt" class="text" maxlength="4" />
					<img id="js-mail_vcode_img" src="http://passport.115.com/?ct=securimage&ac=email" alt="code" />
					<span>
					<a id="js-mail_vcode_a" href="javascript:;" code_src="http://passport.115.com/?ct=securimage&amp;ac=email">
					換一張</a></span> </div>
				<div class="user-agreement">
					<input type="checkbox" id="js-mail_chk" checked="true" />
					<label for="js-mail_chk">同意<a href="http://115.com/agreement.html" target="_blank">《115網盤用戶服務協議》</a></label>
				</div>
				<div class="bottom">
					<a id="js-mail_btn" href="javascript:;" class="button btn-green">
					立即注冊</a></div>
			</div>
		</div>
	</div>
</div>
<script type="text/javascript">
$(document).ready(function() {
	FancyForm.setup();
});
</script>



用戶評論
大牛,別默默的看了,快登錄幫我點評一下吧!:)      登錄 | 注冊


熱門標簽: 切換按鈕 表單 表單美化 表單插件 表單美化插件 文本框 text文本框 表單驗證 表單驗證插件
?
×
×

注冊

官方QQ群

掃描上面二維碼加微信群

官方QQ群

jQuery/js討論群
群號:642649996
Css3+Html5討論群
群號:322131262

加群請備注:從官網了解到

老夫子电子