layer弹出层

实现点击input 输入框有弹窗

获取当前浏览器大小

var _width = $(window).width();
	var _height = $(window).height();
	
 $("#id").click(function(){
    	layui.use("layer",function(){
    	//(若想要加载多个组件,如:时间,表单可用[]  layui.use(['layer','laydate','form'],function(){}))
    	var layer = layui.layer;  //layer初始化
    		layer.open({
    			type: 2,
    			area: [_width*0.7+"px", _height*0.8+"px"],
    			title: "添加商品",
    			content: "page.html?xxId="+xxId
    	});
    	});
    	});

你可能感兴趣的:(前端)