htmld出悬浮窗口代码,怎么实现啊 ???

htmld出悬浮窗口代码,怎么实现啊 ???,第1张

做到比较简单

<!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/htmlcharset=utf-8" />

<title>无标题文档</title>

<style type="text/css">

#apDiv1 {

position:absolute

width:200px

height:115px

z-index:1

background-color:#CCC

left: 165px

top: 211px

display:none

}

</style>

<script type="text/javascript">

function a(){

var a=document.getElementById("a").value

if(a=="tijiao"){

document.getElementById("apDiv1").style.display="block"

}

}

</script>

</head>

<body>

<input type="button" value="tijiao" id="a" onclick="a()" />

<div id="apDiv1">hello</div>

</body>

</html>

需要准备的材料分别有:电脑、浏览器、html编辑器

1、首先,打开html编辑器,新建html文件,例如:index.html,输入问题基础代码

2、在index.html中的<body>标签中,输入js代码:

function fun() {

alert('click success!')

}

3、浏览器运行index.html页面,此时点击按钮d出了提示框。


欢迎分享,转载请注明来源:内存溢出

原文地址: https://outofmemory.cn/zaji/7044672.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2023-04-01
下一篇 2023-04-01

发表评论

登录后才能评论

评论列表(0条)

保存