自定义H5页面dialog弹窗

弹窗一:

样式如下:


HTML代码:

//弹出窗
	<div class="dialog hide">
		<p class="title tc">通知</p>
		<section class="content"></section>
		<div class="dialog-footer">
			<button type="button" type="button" class="dialog-btn cancel">取消</button>
			<button type="button" type="button" class="dialog-btn sure">确认</button>
		</div>
	</div>
	//遮罩层
	<div class="mark hide"></div>
JS代码:
function tipDialog(text){
		$('.dialog .content').text(text);
		$('.dialog, .mark').removeClass('hide');
	}
tipDialog( "1111");
$(".sure").click(function(){
		var type= $(this).attr('type');
		if(type==='bind'){
			var link = '/home/employee/employeeBindCompany';
		}else{
			var link = '/home/employee/employeeUpdateCompany';
		}
		$.ajax({
            type: 'POST',
            url: url + link,
            dataType: 'json',
            contentType: "application/json",//;charset=utf-8
            data: JSON.stringify({
	    	  "phone": phone,
	    	  "companyId": parseInt(companyId,10)
            }),
            success: function (res) {
            	window.location.href="success.html"
            }
        });
	});
	$('.cancel').click(function(){
		$('.dialog, .mark').addClass('hide');
	});



猜你喜欢

转载自blog.csdn.net/tt18473481961/article/details/81016555