惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

V
V2EX
小众软件
小众软件
GbyAI
GbyAI
B
Blog RSS Feed
月光博客
月光博客
A
About on SuperTechFans
Microsoft Security Blog
Microsoft Security Blog
Blog — PlanetScale
Blog — PlanetScale
U
Unit 42
云风的 BLOG
云风的 BLOG
P
Proofpoint News Feed
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Vercel News
Vercel News
F
Fortinet All Blogs
Apple Machine Learning Research
Apple Machine Learning Research
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
雷峰网
雷峰网
Google DeepMind News
Google DeepMind News
MongoDB | Blog
MongoDB | Blog
Engineering at Meta
Engineering at Meta
aimingoo的专栏
aimingoo的专栏
博客园_首页
G
Google Developers Blog

博客园 - boulder

asp.net 利用Cookie实现免登陆(c#) - boulder - 博客园 Md5Encode 算法 导出Excel - boulder - 博客园 获取键盘的enter - boulder - 博客园 oracle 的float(b)转 oracle函数(关于处理小数点位数) char、varchar和varchar2的区别(转) - boulder - 博客园 生成验证码(转) - boulder - 博客园 ASP.NET 2.0利用Httphandler实现URL重写(伪URL及伪静态)(转) .net上传文件的限制 电话号码的验证表达式 GridView 在换页时保持CheckBox的选择 在DataList中找到控件 自定义datatable 没有装Express版Sql Server 2005就不能用WebPart ? (转) form表单 input 通过查询系统表得到纵向的表结构 Codebehind CodeFile转 解决flash的虚框问题
javascript浮动图片 - boulder - 博客园
boulder · 2008-03-17 · via 博客园 - boulder

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="floatImage.aspx.cs" Inherits="jsTest_floatImage" %>

<html>
<head>
</head>
<body>
    <div id="img1" style="z-index: 100; left: 2px; width: 127px; position: absolute;
        top: 43px; height: 96px; visibility: visible;">
        <a href="http://www.baidu.com" target="_blank">
            <img src="http://www.baidu.com/img/logo.gif" width="174" height="59" border="0"></a></div>

    <script>
    var xPos = 300;
var yPos = 200;
var step = 1;
var delay = 30;
var height = 0;
var Hoffset = 0;
var Woffset = 0;
var yon = 0;
var xon = 0;
var pause = true;
var interval;
img1.style.top = yPos;
function changePos()
{
 width = document.body.clientWidth;
 height = document.body.clientHeight;
 Hoffset = img1.offsetHeight;
 Woffset = img1.offsetWidth;
 img1.style.left = xPos + document.body.scrollLeft;
 img1.style.top = yPos + document.body.scrollTop;
 if (yon)
  {yPos = yPos + step;}
 else
  {yPos = yPos - step;}
 if (yPos < 0)
  {yon = 1;yPos = 0;}
 if (yPos >= (height - Hoffset))
  {yon = 0;yPos = (height - Hoffset);}
 if (xon)
  {xPos = xPos + step;}
 else
  {xPos = xPos - step;}
 if (xPos < 0)
  {xon = 1;xPos = 0;}
 if (xPos >= (width - Woffset))
  {xon = 0;xPos = (width - Woffset);   }
 }
 
 function start()
  {
   img1.visibility = "visible";
  interval = setInterval('changePos()', delay);
 }
 function pause_resume()
 {
  if(pause)
  {
   clearInterval(interval);
   pause = false;}
  else
  {
   interval = setInterval('changePos()',delay);
   pause = true;
   }
  }
 start();
    </script>
</body>
</html>