最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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

 更新時間:2015年07月27日 16:34:44   作者:挨踢騎術(shù)  
這篇文章主要介紹了javascript實現(xiàn)類似于新浪微博搜索框彈出效果的方法,涉及javascript彈出搜索框的相關(guān)實現(xiàn)技巧,具有一定參考借鑒價值,需要的朋友可以參考下

本文實例講述了javascript實現(xiàn)類似于新浪微博搜索框彈出效果的方法。分享給大家供大家參考。具體實現(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="搜索他說的話";
}
</script>
<div class="weibo">
  <div class="so">
  <form>
  <input type="text" value="搜索他說的話" onfocus="s_show()" id="s_so"/>
  <input type="submit" value="查找" />
  </form>
  </div>
  <div id="show">
  <p>搜索他說的話<span onclick="closed()">X</span></p>
  <form>
   <input type="text" value="" id="b_so"/><input type="submit" value="查找" />
  </form>
  </div>
</div>
</body>
</html>

運行效果如下:

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

相關(guān)文章

最新評論

廉江市| 金堂县| 柳河县| 怀集县| 荆门市| 嘉善县| 乌兰察布市| 宝清县| 满洲里市| 邯郸县| 岑巩县| 平南县| 新昌县| 石楼县| 灵武市| 双桥区| 永州市| 大城县| 呈贡县| 界首市| 祥云县| 浙江省| 汉源县| SHOW| 驻马店市| 车险| 漳浦县| 如皋市| 龙川县| 景宁| 象州县| 柳河县| 罗山县| 九龙坡区| 城市| 凤阳县| 广元市| 赤城县| 阳城县| 溧阳市| 商丘市|