模拟手机短信发送
2017-09-08 00:00
423 查看
摘要: 模拟手机短信发送
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Title</title> <style> #message{ width:400px; height: 400px; border:#cccccc solid 1px; background-color: #cccccc; margin:0 auto; } .fl,.fr{ float:none; } .fl li{ margin-left: 5px; float: left; list-style: none; } .fr li{ margin-right: 5px; float: right; list-style: none; } .fl p{line-height: 28px; max-width: 280px; background-color: red; margin-left: 40px; } .fr p{line-height: 28px; max-width: 280px; background-color: red; float: right; } .fr ,.fl{margin-bottom: 5px;} .set{ width: 400px; margin:0 auto; } </style> </head> <body> <div id="message"> <ul class="fl"> <li><img src="img1/1.jpg" alt="#"></li> <p>发送信息发送信息发送信息发送信息发送信息发送信息</p> </ul> <ul class="fr"> <li><img src="img1/2.jpg" alt="#"></li> <p>发送信息发送信息发送信息发送信息发送信息发送信息</p> </ul> </div> <div class="set"> <span><img src="img1/1.jpg" alt="#" id="img"></span> <input type="text" id="text" name="text"> <input type="button" id="button" value="发送"> </div> </body> <script> var oImg=document.getElementById("img"); var text=document.getElementById("text"); var button=document.getElementById("button"); var message=document.getElementById("message"); var fl=document.getElementsByClassName("fl"); var fr=document.getElementsByClassName("fr"); var onclickImg=true; oImg.onclick=function () { if(onclickImg){ oImg.src="img1/1.jpg"; }else{ oImg.src="img1/2.jpg"; } onclickImg=! onclickImg; } button.onclick=function () { if (onclickImg){ message.innerHTML='<ul class="fl"><li><img src="img1/1.jpg" alt="#"></li>' + ' <p>'+text.value+'</p> </ul><br>'+message.innerHTML; }else{ message.innerHTML='<ul class="fr"><li><img src="img1/2.jpg" alt="#"></li>' + ' <p>'+text.value+'</p> </ul><br>'+message.innerHTML; } onclickImg=! onclickImg; text.value=''; } </script> </html>
相关文章推荐
- day03-模拟手机短信发送
- JS基础—模拟手机短信发送
- 第1课--1.1模拟手机短信发送
- js模拟手机短信发送
- Android学习笔记(5)---模拟手机发送短信
- innerHTML应用模拟手机短信发送
- 模拟手机短信发送
- Android ---模拟手机发送短信
- android手机短信发送
- 微信开发之移动手机WEB页面(HTML5)Javascript实现一键拨号及短信发送功能
- 发送手机短信的倒计时
- java web 项目向手机发送短信
- 微信开发之移动手机WEB页面(HTML5)Javascript实现一键拨号及短信发送功能
- 11/4.22 用OBJECT编写苹果手机发送短信的编程注定失败了。。。哎。。。
- java程序或javaweb(网站)向手机发送短信
- C#简单实现发送手机短信
- Java调用WebService接口实现发送手机短信验证码功能
- c#实现手机短信发送(2)
- Java发送SMS短信到手机
- 手机连接PC通过串口发送PDU短信. 没有Iphone也可以欺骗了!