国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 編程 > JavaScript > 正文

javascript實(shí)現(xiàn)類(lèi)似于新浪微博搜索框彈出效果的方法

2019-11-20 11:59:18
字體:
來(lái)源:轉(zhuǎn)載
供稿:網(wǎng)友

本文實(shí)例講述了javascript實(shí)現(xiàn)類(lèi)似于新浪微博搜索框彈出效果的方法。分享給大家供大家參考。具體實(shí)現(xiàn)方法如下:

<!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=gb2312" /><title>仿新浪微博搜索框彈出的效果</title><style type="text/css">body{font-size:12px;}.weibo{width:500px; height:200px; position:relative;}.so{width:200px; height:24px; margin:30px;}.so #s_so{width:100px; border:1px solid #ccc; line-height:20px; height:20px;}#show{display:none; position:absolute; top:0px; left:10px; width:200px; height:60px; background:#fff; font-size:12px; border:1px solid #ccc; padding:10px;}#show span{margin-left:120px; color:#F00; cursor:pointer;}</style></head><body><script type="text/javascript">var $=function (id){  return document.getElementById(id);  }function s_show(){$('s_so').value="";$("show").style.display='block';$("b_so").focus(); }function closed(){$("show").style.display='none';$('s_so').value="搜索他說(shuō)的話";}</script><div class="weibo">  <div class="so">  <form>  <input type="text" value="搜索他說(shuō)的話" onfocus="s_show()" id="s_so"/>  <input type="submit" value="查找" />  </form>  </div>  <div id="show">  <p>搜索他說(shuō)的話<span onclick="closed()">X</span></p>  <form>   <input type="text" value="" id="b_so"/><input type="submit" value="查找" />  </form>  </div></div></body></html>

運(yùn)行效果如下:

希望本文所述對(duì)大家的javascript程序設(shè)計(jì)有所幫助。

發(fā)表評(píng)論 共有條評(píng)論
用戶名: 密碼:
驗(yàn)證碼: 匿名發(fā)表
主站蜘蛛池模板: 义马市| 公安县| 高台县| 武安市| 浙江省| 东光县| 内丘县| 盱眙县| 贺兰县| 桐城市| 江孜县| 通渭县| 尼木县| 房山区| 甘谷县| 刚察县| 班戈县| 长海县| 博湖县| 小金县| 彰武县| 昂仁县| 徐汇区| 九龙县| 托里县| 亳州市| 和顺县| 右玉县| 颍上县| 清远市| 花莲县| 泸定县| 文登市| 永兴县| 利津县| 松江区| 青州市| 祁东县| 兰溪市| 夏邑县| 丰都县|