當前位置:編程學習大全網 - 站長素材 - 怎麽在壹個網頁上彈出壹個二維碼圖片?

怎麽在壹個網頁上彈出壹個二維碼圖片?

用JS的onmouseover事件。代碼如下

<!DOCTYPE html>

<html>

<head>

<meta charset="utf-8">

<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

<meta name="viewport" content="width=device-width,initial-scale=1.0" />

<title>Examples</title>

<meta name="description" content="">

<meta name="keywords" content="">

<link href="" rel="stylesheet">

<style type="text/css">

*{margin:0;padding:0;}

a{text-decoration: none;}

li{list-style: none;border:1px solid red;width:100px;height:auto;}

img{

display: inline-block;

width: 100%;

}

a{font-size:18px;color:red;}

#box{

position: relative;

width: 1200px;

margin: auto;

text-align: center;

}

img{

width:200px;

}

#pic2{

position: absolute;

right: 295px;

}

.none{

display: none;

}

.active{

display: inline-block;

}

</style>

</head>

<body>

<div id="box">

<img src="1.jpg" alt="" id="pic1">

<img src="6.jpg" id="pic2" class='none'>

</div>

<script>

var obox = document.getElementById('box');

var opic1 = document.getElementById('pic1');

var opic2 = document.getElementById('pic2');

pic1.onmouseover = function(){

opic2.className = 'active';

}

pic1.onmouseout = function(){

opic2.className = 'none';

}

</script>

</body>

</html>

  • 上一篇:LOL打野怎麽玩
  • 下一篇:1)-Did you get your pay? -Yes,I remember___.But I forget the exact amount. Q:答案給的是Paying。
  • copyright 2024編程學習大全網