2个回答
展开全部
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#divid {
position:fixed;
z-index:2000;
left:50%;
top:50%;
transform:translate(-50%,-50%);
}
#imgid {
width:1000px;
height:500px;
}
</style>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.js"></script>
<script >
function myFunction(){
var src=$("#imgip").attr("src")
$("#imgid").attr("src",src)
$("#divid").css("display","block")
}
function myFunc(){
$("#divid").css("display","none")
}
</script>
</head>
<body>
<img id="imgip" onclick="myFunction()" src=""/>
<div style="display:none;" id="divid" >
<img onclick="myFunc()" src="" id="imgid" />
</div>
</body>
</html>
<html>
<head>
<meta charset="utf-8">
<style type="text/css">
#divid {
position:fixed;
z-index:2000;
left:50%;
top:50%;
transform:translate(-50%,-50%);
}
#imgid {
width:1000px;
height:500px;
}
</style>
<script src="https://ajax.aspnetcdn.com/ajax/jQuery/jquery-3.3.1.js"></script>
<script >
function myFunction(){
var src=$("#imgip").attr("src")
$("#imgid").attr("src",src)
$("#divid").css("display","block")
}
function myFunc(){
$("#divid").css("display","none")
}
</script>
</head>
<body>
<img id="imgip" onclick="myFunction()" src=""/>
<div style="display:none;" id="divid" >
<img onclick="myFunc()" src="" id="imgid" />
</div>
</body>
</html>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询