<html>
<head>
<meta charset="UTF-8">
<title></title>
</head>
<body>
<style type="text/css">
#demo {
width: 100px
height: 100px
position:absolute
border-radius:50px
}
</style>
<script type="text/javascript">
window.onload = function(){
var demo = document.getElementById('demo')
var sx = sy = 10
var x = y = 0
function move(){
if(document.documentElement.clientWidth - demo.offsetWidth-10 < x || x < 0){
sx = -sx
}
if(document.documentElement.clientHeight - demo.offsetHeight-10 < y || y < 0){
sy = -sy
}
x = demo.offsetLeft + sx
// y = demo.offsetTop + sy
demo.style.left = x + 'px'
// demo.style.top = y + 'px'
}
var timer = setInterval(move, 100)
demo.onmouseover = function(){
clearInterval(timer)
}
demo.onmouseout = function(){
timer = setInterval(move, 100)
}
}
</script>
<img src="https://gss0.baidu.com/-Po3dSag_xI4khGko9WTAnF6hhy/image/w%3D2048/sign=48fd3c26f01fbe091c5ec4145f580d33/64380cd7912397dd92729b545b82b2b7d0a28752.jpg" id="demo" />
</body>
</html
>
#mod_mylink3 { /* 文章分类模块 */margin-bottom:-1px}#mod_mylink3 .modth { /* 模块题头 */border-bottom:2px solid #000}#mod_mylink3 .modbox{ /* 模块箱体 */padding-top:0pxborder:0pxbackground:url(http://hiphotos.baidu.com/xianqingyaqu/pic/item/ae53031a622b03368618bf8a.jpg)}}#m_mylink3 { /* 内容区 */width:680pxheight:25pxmargin-top:0pxmargin-left:0pxpadding:0px}#m_mylink3 .item { /* 项目区 */float:leftwidth:110pxheight:23pxmargin-left:2pxpadding-top:2pxtext-align:centeroverflow:visibleborder-left:1px solid #00FF00border-top:1px solid #00FF00border-right:2px solid #000border-bottom:2px solid #000}#m_mylink3 .item a, #m_mylink3 .item a:visited { /* 项目文字链 */width:74pxheight:0pxpadding-top:0pxcolor:#FFFFFF!importantfont-size:14px}#m_mylink3 .item a:hover { /* 项目文字链(鼠过) */font-size:14px}#m_mylink3 .line { /* 分割线 */display:none}#m_mylink3 { /*****************置顶开始*****************/position:absolute/*绝对*/!importantwidth:325pxtop:197pxleft:600px}#mod_mylink3 {border:0px}#mod_mylink3 .modth,#mod_mylink3 .modbl,#mod_mylink3 .modbc,#mod_mylink3 .modbr { /* 屏蔽模块头尾 */display:none}#m_mylink3 .item { /************repeat-x center top*****置顶结束*****************/width:74pxheight:28pxmargin-left:0pxpadding-top:2pxborder:0px!importantFONT-SIZE: 12pxBACKGROUND: url(http://hiphotos.baidu.com/xianqingyaqu/pic/item/1097977e7fc7fe2729388a38.jpg
) no-repeat center topWIDTH: 80pxCOLOR: #FFFFFFPADDING-TOP: 5pxTEXT-ALIGN: centerTEXT-DECORATION: none}#m_mylink3 A.on , #m_mylink3 A.on:link, #m_mylink3 A.on:visited {FONT-SIZE: 12pxBACKGROUND: url(http://hiphotos.baidu.com/xianqingyaqu/pic/item/46197cbe1f7c7a2518d81f14.jpg
) no-repeat centerWIDTH: 80pxCOLOR: whitePADDING-TOP: 5pxTEXT-ALIGN: centerTEXT-DECORATION: none}#m_mylink3 a:hover{color:#FFFline-height:23pxfont-weight:boldtext-decoration:nonebackground:#392b18}/*----↑望埠中学共青团----【自定义模块3】----2009.12.09↑----*/========================说明:(1)(width:325pxtop:197pxleft:600px)这组代码是宽.高.以右边开始的距离。(2)(width:680pxheight:25pxmargin-top:0pxmargin-left:0pxpadding:0px)我设置4个,如果你在填加或减少您的修改数值。(3)图片地址您要从新上传,因为我要删除。