本文实例讲解了javascript实现右侧弹出“分享到”窗口的详细代码,分享给大家供大家参考,具体内容如下
效果图:
具体代码:
<meta charset="gb2312"><title></title><style type="text/css"> body { padding: 0; margin: 0; } #div1 { width: 100px; height: 150px; background-color: #1B6D85; left:-100px; position: absolute; } #div1 span { width: 20px; height: 100px; line-height: 30px; background-color:#1B6D85; left:100px; top:20px; position: absolute; } </style><script type="text/javascript"> window.onload = function() { var oDiv1 = document.getElementById('div1'); oDiv1.timer = null; oDiv1.onmouseover = function() { startMove(this, 0); }; oDiv1.onmouseout = function() { startMove(this, -100); }; }; window.onscroll = function () { var oDiv1 = document.getElementById('div1'); var ioffsetMiddle = document.documentElement.scrollTop || document.body.scrollTop; ioffsetMiddle = ioffsetMiddle + (document.documentElement.clientHeight - oDiv1.offsetHeight) / 2; //</script>
java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号