怎么能让悬浮的图片 在li的右上角啊

<!DOCTYPE html>

<html>

<head>

<meta charset="UTF-8">

<title>兼容所有的触摸事件</title>

<style type="text/css">

ul{width:255px;margin:100px auto;list-style: none;position: relative;}

li{width:60px;display: inline-block; *display:inline-block;*zoom:1}

img{width:50px;height:50px;}

#show{display: none; position: absolute;}

</style>

</head>

<body>

  <ul>

   <li>

   <img src="img/1.jpg" alt="">     

   </li>

   <li>

   <img src="img/2.jpg" alt="">    

   </li>

   <li>

   <img src="img/3.jpg" alt="">     

   </li>

  <img src="img/4.jpg" alt="" id="show"> 

  </ul>

  <script type="text/javascript">

    img=document.getElementsByTagName("img");

    img1=document.getElementById("show");

    for(var i=0;i<img.length;i++){

    img[i].onmouseover=function(){

     img1.style.display="block";

     img1.style.left="30px";

     img1.style.top="60px";

    }

     img[i].onmouseout=function(){

     img1.style.display="none";

    }

   }

  </script>

</body>

</html>


qq_不像白羊座的白羊座_0
浏览 2795回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP