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

推荐订阅源

Google Online Security Blog
Google Online Security Blog
C
CXSECURITY Database RSS Feed - CXSecurity.com
C
CERT Recently Published Vulnerability Notes
C
Cybersecurity and Infrastructure Security Agency CISA
Cisco Talos Blog
Cisco Talos Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
Scott Helme
Scott Helme
Project Zero
Project Zero
E
Exploit-DB.com RSS Feed
S
Secure Thoughts
K
Kaspersky official blog
L
Lohrmann on Cybersecurity
NISL@THU
NISL@THU
WordPress大学
WordPress大学
N
News and Events Feed by Topic
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
L
LINUX DO - 热门话题
小众软件
小众软件
P
Privacy & Cybersecurity Law Blog
博客园 - 聂微东
Google DeepMind News
Google DeepMind News
H
Hackread – Cybersecurity News, Data Breaches, AI and More
A
About on SuperTechFans
Hacker News: Ask HN
Hacker News: Ask HN
AWS News Blog
AWS News Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
H
Hacker News: Front Page
F
Full Disclosure
Latest news
Latest news
Schneier on Security
Schneier on Security
The Hacker News
The Hacker News
T
Troy Hunt's Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Jina AI
Jina AI
Martin Fowler
Martin Fowler
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
G
GRAHAM CLULEY
Forbes - Security
Forbes - Security
V
V2EX - 技术
酷 壳 – CoolShell
酷 壳 – CoolShell
V
Vulnerabilities – Threatpost
C
Cyber Attacks, Cyber Crime and Cyber Security
MongoDB | Blog
MongoDB | Blog
博客园 - 三生石上(FineUI控件)
S
SegmentFault 最新的问题
Hugging Face - Blog
Hugging Face - Blog
P
Privacy International News Feed
C
Check Point Blog
N
News and Events Feed by Topic

博客园 - point.deng

Pinax安装笔记 CuteEditor使用心得 asp.net 中的default button DIV+CSS实现圆角 欢迎使用我的控件 有用的SQL语句,更新中~ asp.net 实现多语言界面 关于WebService中SOAP扩展求助~~ - point.deng - 博客园 同一账号多次登录 WEB自定义控件小记 C# 使用HOOK 小记 视频转为flv和图片 Asp.net上传图片产生预览效果(转) asp.net2.0用户和角色管理 javascript 练习 Ajax示例 asp.net开发小技巧 Master Page主题以及皮肤的使用 ASP.NET 2.0网站快速导航
悬浮的购物车 - point.deng - 博客园
point.deng · 2008-05-14 · via 博客园 - point.deng

今天在项目中看到可能会用到这个东西,我做了个小例子,其原理就是把一个层(定位一定要是absolute),在页面滚动的时候,触发事件,改变这个层的位置。
一、定义这个层:
     <div id="div1" style="position: absolute; z-index: 10000; background-color: Red;
        width: 300px; height: 200px;">
        这是一个悬浮的层!
    </div>
二、定义改变层位置的方法:
      function scrolls()
    {
        div1.style.marginTop=document.documentElement.scrollTop+div1.clientHeight;              div1.style.marginLeft=document.documentElement.scrollLeft+document.body.clientWidth - div1.clientWidth;
    }
三、在滚动事件中调用方法:
 window.onscroll = function()
    {
        scrolls();
    }

四、在加载事件中调用方法:
 window.onload=function()
    {
        scrolls();
    }

我不是最强的,但我是最努力的!