用jQuery和Bootstrap实现的多步骤表单页面源码

大家好,今天给大家介绍一款,用jQuery和Bootstrap多步骤表单页面源码(图1)。送给大家哦,获取方式在本文末尾。

图1

带步骤简介(图2)

图2

切换效果看起来也很不错(图3)

图3

部分代码:

//jQuery time
var current_fs, next_fs, previous_fs; //fieldsets
var left, opacity, scale; //fieldset properties which we will animate
var animating; //flag to prevent quick multi-click glitches

$(".next").click(function(){
	if(animating) return false;
	animating = true;
	
	current_fs = $(this).parent();
	next_fs = $(this).parent().next();
	
	//activate next step on progressbar using the index of next_fs
	$("#progressbar li").eq($("fieldset").index(next_fs)).addClass("active");
	
	//show the next fieldset
	next_fs.show(); 
	//hide the current fieldset with style
	current_fs.animate({opacity: 0}, {
		step: function(now, mx) {
			//as the opacity of current_fs reduces to 0 - stored in "now"
			//1. scale current_fs down to 80%
			scale = 1 - (1 - now) * 0.2;
			//2. bring next_fs from the right(50%)
			left = (now * 50)+"%";
			//3. increase opacity of next_fs to 1 as it moves in
			opacity = 1 - now;
			current_fs.css({
        'transform': 'scale('+scale+')',
        'position': 'absolute'
      });
			next_fs.css({'left': left, 'opacity': opacity});
		}, 
		duration: 800, 
		complete: function(){
			current_fs.hide();
			animating = false;
		}, 
		//this comes from the custom easing plugin
		easing: 'easeInOutBack'
	});
});

$(".previous").click(function(){
	if(animating) return false;
	animating = true;
	
	current_fs = $(this).parent();
	previous_fs = $(this).parent().prev();
	
	//de-activate current step on progressbar
	$("#progressbar li").eq($("fieldset").index(current_fs)).removeClass("active");
	
	//show the previous fieldset
	previous_fs.show(); 
	//hide the current fieldset with style
	current_fs.animate({opacity: 0}, {
		step: function(now, mx) {
			//as the opacity of current_fs reduces to 0 - stored in "now"
			//1. scale previous_fs from 80% to 100%
			scale = 0.8 + (1 - now) * 0.2;
			//2. take current_fs to the right(50%) - from 0%
			left = ((1-now) * 50)+"%";
			//3. increase opacity of previous_fs to 1 as it moves in
			opacity = 1 - now;
			current_fs.css({'left': left});
			previous_fs.css({'transform': 'scale('+scale+')', 'opacity': opacity});
		}, 
		duration: 800, 
		complete: function(){
			current_fs.hide();
			animating = false;
		}, 
		//this comes from the custom easing plugin
		easing: 'easeInOutBack'
	});
});

$(".submit").click(function(){
	return false;
})

本模板编码:10118,需要的朋友,关注下面微信公众号后,搜索10118,即可获取。

就爱UI - 分享UI设计的点点滴滴

  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
jQuery Bootstrap是一个非常受欢迎的JavaScript库和前端框架,可用于开发交互式的网页应用程序。它提供了丰富的组件和工具,以简化开发过程并提高用户体验。而拖拽表单可视化设计器是一种功能,允许用户通过拖拽和放置表单元素来快速创建表单界面。 实现拖拽表单可视化设计器的源码可以包括以下主要功能: 1. 初始化设计器:使用jQueryBootstrap创建一个空白页面,设置拖拽区域和工具栏。 2. 表单元素的拖拽:为表单元素添加拖拽事件,使它们可以被拖拽到拖拽区域。这可以通过jQuery UI中的拖拽功能来实现。 3. 表单元素的放置:通过设置拖拽区域的放置事件,将被拖拽的表单元素放置到指定位置,并实时显示其样式和属性。 4. 表单元素的编辑:在放置表单元素后,可以通过双击或右键单击来触发表单元素的编辑功能,允许用户修改表单元素的属性,例如标签文本、字段类型和验证规则等。 5. 表单元素的删除:通过右键菜单或其他交互方式,提供删除表单元素的功能,以便用户可以轻松地删除不需要的元素。 6. 表单元素的布局:通过拖拽和调整表单元素的位置和大小,可以实现表单界面的布局调整,以达到用户的需求。 7. 表单界面的保存和导出:提供保存和导出设计好的表单界面的功能,以便后续使用或分享。 通过结合jQueryBootstrap的强大功能,上述源码可以实现一个直观易用的拖拽表单可视化设计器,用户可以轻松创建自定义的表单界面,而无需编写复杂的代码。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值