<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>无标题文档</title>
<style>
*{
margin: 0px;
padding: 0px;
}
#wrap{
border: 1px solid #ccc;
background: white;
width:300px;
height:480px;
margin:0 auto;
position: relative;
margin-top: 10px;
}
#text{
width: 270px;
height: 400px;
border: 1px solid #ccc;
position: absolute;
left: 15px;
top:20px;
}
#face{
width: 24px;
height: 24px;
border: 1px solid #ccc;
display: inline-block;
background: url(images/icon4.png);
left:15px;
top:435px;
position: absolute;
} #writen{
height: 24px;
position: absolute;
top:435px;
left: 50px;
width:180px;
border-radius: 5px; }
#button{
position: absolute; right: 15px;
height: 25px;
width: 40px;
top:435px;
}
.right{
position:absolute;
right:33px;
background:pink;
padding:2px;
} .left{
position:absolute;
left:33px;
background:#ccc;
padding:2px;
} </style>
<script>
window.onload = function (){
var oText = document.getElementById("text");
var oFace = document.getElementById("face");
var aInput = document.getElementsByTagName("input");
var onff = true; aInput[1].onclick = function (){ if(!aInput[0].value){
alert("Please Input");
}
else if( onff){
oText.innerHTML = '<p style="height:25px;line-height:25px;background:#ccc;float:right;margin-right:35px;margin-top:3px;padding:2px;clear:both;"><img src= "images/icon4.png"style="position:absolute;right:5px;">'+ aInput[0].value +'</p>' + oText.innerHTML;
aInput[0].value = "";
}
else {
oText.innerHTML = '<p style="height:25px;line-height:25px;background:pink;float:left;margin-left:35px;margin-top:3px;padding:2px;clear:both;"><img src= "images/icon3.png"style="position:absolute;left:5px;">'+ aInput[0].value +'</p>' + oText.innerHTML;
aInput[0].value = "";
}
}
oFace.onclick = function(){ if(onff){
oFace.style.background ="url(images/icon3.png)";
onff = !onff;
}
else
{
oFace.style.background ="url(images/icon4.png)";
onff = !onff;
}
}
}
</script>
</head>
<body>
<div id = "wrap">
<div id = "text"> </div> <div id = "face"></div>
<input type = "text" id = "writen">
<input type = "button" id = "button" value = "发送"> </div>
</body>
</html>

js 模拟发短信的更多相关文章

  1. js实现发送短信验证码后的倒计时功能(无视页面刷新)

    [1].[代码] 这是页面上的发送验证码按钮 跳至 [1] [2] [3]<input id="second" type="button" value=& ...

  2. html页面通过特殊链接:打电话,发短信,发邮件详细教程

    采用url href链接的方式,实现在Safari  ios,Android 浏览器,webos浏览器,塞班浏览器,IE,Operamini等主流浏览器,进行拨打电话功能. 1. 拨打电话 在电话号码 ...

  3. 移动设备wap手机网页html5通过特殊链接:打电话,发短信,发邮件详细教程

    如果需要在移动浏览器中实现拨打电话,调用sms发短信,发送email等功能,移动手机WEB页面(HTML5)Javascript提供的接口是一个好办法. 采用url href链接的方式,实现在Safa ...

  4. html5开发手机打电话发短信功能

    原文:http://www.open-open.com/code/view/1449843459332 在很多的手机网站上,有打电话和发短信的功能,对于这些功能是如何实现的呢.其实不难,今天我们就用h ...

  5. html5开发手机打电话发短信功能,html5的高级开发,html5开发大全,html手机电话短信功能具体解释

    在非常多的手机站点上,有打电话和发短信的功能,对于这些功能是怎样实现的呢.事实上不难,今天我们就用html5来实现他们. 简单的让你大开眼界.HTML5 非常easy写,但创建网页时,您常常须要反复做 ...

  6. iOS开发之调用系统打电话发短信接口以及程序内发短信

    在本篇博客开头呢,先说一下写本篇的博客的原因吧.目前在做一个小项目,要用到在本应用程序内发验证码给其他用户,怎么在应用内发送短信的具体细节想不大起来了,于是就百度了一下,发现也有关于这方面的博客,点进 ...

  7. 打电话,发短信,发邮件,app跳转

    1.打电话 - (IBAction)callPhone1:(id)sender { NSURL *url = [NSURL URLWithString:@"tel://18500441739 ...

  8. linux下利用GPRS模块发短信、打电话

    一.开发环境     内核版本:linux-3.0    开发板:FL2440(nandflash:K9F1G08 128M)    GPRS模块:SIM900   二.与发短信和拨号相关的 AT 指 ...

  9. iOS中如何切换到发短信、打电话、发邮件

    我们在做APP的时候,难免会遇到需要调用短信,电话等程序的时候.如美团. 当然,这些都只是一些简单的方法就可以实现,但是时间久了也会淡忘,所以想写这边博客.一是为了再捡起来复习一下,另一个相当于留个备 ...

随机推荐

  1. [译]从列表或字典创建Pandas的DataFrame对象

    原文来源:http://pbpython.com/pandas-list-dict.html 介绍 每当我使用pandas进行分析时,我的第一个目标是使用众多可用选项中的一个将数据导入Pandas的D ...

  2. Web进程被kill掉后线程还在运行怎么办?

    目录 背景描述 原因分析 处理方案 参考 背景描述 系统有一个配置表,系统在启动后会启动一个线程,每隔5分钟将配置表里所有的数据更新到内存中. 系统是通过jenkins构建(直接kill掉Web进程, ...

  3. WINDOWS开发PHP7扩展

    最近在做个项目,需要用到唯一ID的生成,原本在Java和Delphi中,做了一个生成20位字符串(160bit)形式的唯一ID的算法,但是对比GUID(128bit),除了看起来比他短之外,其他并无优 ...

  4. AngularJs 特性 之 指令系统

    <!DOCTYPE html> <html ng-app="myApp"> <head> <meta charset="utf- ...

  5. Repeater嵌套(灵活的)

    页面代码 <form id="form1" runat="server"> <asp:Repeater ID="rptCategor ...

  6. e.keyCode和e.which使用

    1. 不使用jquery获取keyCode var key = 'which' in e ? e.which : e.keyCode;//或者var key = e.which || e.keyCod ...

  7. 数组去重js方式

    var selectmap = new Array(); /(\x0f[^\x0f]+)\x0f[\s\S]*\1/.test("\x0f"+selectmap.join(&quo ...

  8. How Many to Be Happy?

    How Many to Be Happy? 时间限制: 1 Sec  内存限制: 128 MB 题目描述 Let G be a connected simple undirected graph wh ...

  9. SpringBoot中使用RestTemplate

    spring框架提供的RestTemplate类可用于在应用中调用rest服务,它简化了与http服务的通信方式,统一了RESTful的标准,封装了http链接, 我们只需要传入url及返回值类型即可 ...

  10. 代码怎样重构<1>

    原文发布时间为:2011-05-24 -- 来源于本人的百度文章 [由搬家工具导入]