苹果系统 ios 微信摇一摇页面弹出 撤销 的解决办法

场景:抢红包,可以发送弹幕,且发送弹幕和抢红包一个页面上。

把input框弹幕写一个页面,就一个文本框即可。danmu.html

<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8">
<title></title>
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-capable" content="yes" />
<meta name="apple-mobile-web-app-status-bar-style" content="blank" />

<link rel="stylesheet" type="text/css" href="static/css/index.css"/>
<script src="http://res.wx.qq.com/open/js/jweixin-1.4.0.js"></script>
<script src="static/js/jquery.min.js"></script>
<style>
#dandan{
	width:95%;
}
</style>
</head>

<body>

<input type="text" value="" id="dandan" maxlength="20"/>

</body>


<script>


</script>
</html>

在抢红包页面 index.html相应的地方引入danmu.html页面

<iframe src="danmu.html" width="100%" id="input-dandan" frameborder="0"></iframe>

 

点击发送弹幕按钮的方法里,父页面获取子页面的元素,js如下,获取发送弹幕的内容

var dandanval = $("#input-dandan").contents().find("#dandan").val();

 当弹幕发送成功后回调函数里可以重新加载一遍danmu.html页面

$("#input-dandan").attr('src', "danmu.html");

完美解决。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

专业技术人员继续教育学习助手

你的鼓励是我创造的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值