	<script type="text/javascript" charset="utf-8">
		layui.use(['sliderVerify', 'jquery', 'form'], function() {
			var sliderVerify = layui.sliderVerify,
				$ = layui.jquery,
				form = layui.form;
			var slider = sliderVerify.render({
				elem: '#slider',
				onOk: function(){//当验证通过回调
					$('sliderVerify').val(1);
					layer.msg("滑块验证通过");
				}
			})
			$('#reset').on('click',function(){
				slider.reset();
			})
			//监听提交
			form.on('submit(formDemo)', function(data) {
				if(slider.isOk()){
					return true;
				}else{
					layer.msg("请先通过滑块验证");
				}
				return false;
			});

		})
	</script>