点击选择按钮-弹框选择选项-选定后自动延迟关闭弹框,选择内容填入标签内(手机端)...

HTML代码:

js代码:

 

    

 

测试源码如下:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=no">
<title>无标题文档</title>
<style>
.layer_a{position:fixed;top:0px;left:0px;z-index:10;height:100%;width:100%;display:none;}
.bg_layer{position:absolute;z-index:10;top:0px;left:0px;width:100%;height:100%;background-color:#000000;opacity:0.3;}
.layer_a .layer_connect{position:absolute;bottom:85px;left:10%;z-index:11;width:80%;max-height:70%;overflow:hidden;overflow-y:auto;line-height:30px;padding:10px;border-radius:4px;background-color:#fff;}
.layer_a label{padding-left:10px;}
</style>
</head>

<body>
<div>
<h4>选择插入广告:</h4>
<p class="btn_layer">
<button type="button">选择广告</button><br />
<span class="txt_show">广告:<em></em></span>
</p>
<form class="layer_a" >
<div class="bg_layer"></div>
<div class="layer_connect bg_white">
<label>
<input name="ad_choose" type="radio" checked="checked" /><span class="text">顶部广告样式1</span>
</label><br>
<label>
<input name="ad_choose" type="radio" checked="checked" /><span class="text">顶部广告样式2</span>
</label><br>
<label>
<input name="ad_choose" type="radio" checked="checked" /><span class="text">顶部广告样式1</span>
</label><br>
<label>
<input name="ad_choose" type="radio" checked="checked" /><span class="text">顶部广告样式2</span>
</label>
</div>
</form>
</div>
</body>
<script src="jquery.min.js"></script>
<script>
//点击显现
$(".btn_layer").click(function () { $(".layer_a").show(); });
//选择后消失
$(".layer_a").find("input:radio").click(function () {
var val = $(this).next(".text").text();
$(".btn_layer").find(".txt_show").children("em").text(val);
setTimeout(function () {
$(".layer_a").hide();
}, 500);

})
</script>
</html>

转载于:https://www.cnblogs.com/LChenglong/p/6562407.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值