当前位置: 首页> 健康> 科研 > 专业网站建设大型公司_全球疫情_广州最新疫情_新闻头条国内大事

专业网站建设大型公司_全球疫情_广州最新疫情_新闻头条国内大事

时间:2025/7/9 6:40:47来源:https://blog.csdn.net/2302_80346539/article/details/144043431 浏览次数:0次
专业网站建设大型公司_全球疫情_广州最新疫情_新闻头条国内大事

1.在网页中显示一个工作中的“数字时钟”

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>动态时钟</title><style>.all{width: 600px;height: 300px;margin: 100px auto;text-align: center;font-size: 50px;}#clock{margin-top: 50px;margin-left: 100px;width: 400px;height: 100px;font-size: 100px;text-align: center;font: bold;color: black;}.text{font-size: 30px;font-weight: bold;}</style><script type="text/javascript">function showTime(clock){var now = new Date();var hour = now.getHours();var minu = now.getMinutes();var second = now.getSeconds();var time =hour+":"+minu+":"+second;clock.innerHTML=time;}window.onload = function(){var clock = document.getElementById("clock");window.setInterval("showTime(clock)",1000);}</script></head><body><div class="all"><p>数字时钟</p ><div id ="clock"></div></div>	</body>
</html>

2.制作一个“禁止使用鼠标右键”操作的网页。当浏览者在页面上右击时,自动弹出一个警告对话框,禁止用户使用右键快捷菜单。

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title>禁止下载</title><style>img{width: 600px;height: 400px;margin-left: 200px;}</style></head><body><p id="img"><img src="img/cat.jpg" /></p ><script type="text/javascript">var demo=document.getElementById("img");demo.oncontextmenu=a;function a(){alert("禁止下载图片!");}document.addEventListener('contextmenu',function(b){b.preventDefault();});</script></body>
</html>

关键字:专业网站建设大型公司_全球疫情_广州最新疫情_新闻头条国内大事

版权声明:

本网仅为发布的内容提供存储空间,不对发表、转载的内容提供任何形式的保证。凡本网注明“来源:XXX网络”的作品,均转载自其它媒体,著作权归作者所有,商业转载请联系作者获得授权,非商业转载请注明出处。

我们尊重并感谢每一位作者,均已注明文章来源和作者。如因作品内容、版权或其它问题,请及时与我们联系,联系邮箱:809451989@qq.com,投稿邮箱:809451989@qq.com

责任编辑: