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

推荐订阅源

T
Tailwind CSS Blog
C
CERT Recently Published Vulnerability Notes
P
Proofpoint News Feed
Vercel News
Vercel News
博客园 - 三生石上(FineUI控件)
IT之家
IT之家
Help Net Security
Help Net Security
月光博客
月光博客
N
News and Events Feed by Topic
Cloudbric
Cloudbric
博客园 - 司徒正美
L
LangChain Blog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
T
Tenable Blog
The Register - Security
The Register - Security
The Hacker News
The Hacker News
I
InfoQ
The Last Watchdog
The Last Watchdog
MyScale Blog
MyScale Blog
Schneier on Security
Schneier on Security
WordPress大学
WordPress大学
小众软件
小众软件
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
宝玉的分享
宝玉的分享
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
K
Kaspersky official blog
L
LINUX DO - 热门话题
N
News | PayPal Newsroom
F
Fortinet All Blogs
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
S
Security @ Cisco Blogs
Recorded Future
Recorded Future
大猫的无限游戏
大猫的无限游戏
H
Help Net Security
Google Online Security Blog
Google Online Security Blog
S
Schneier on Security
C
Cisco Blogs
N
News and Events Feed by Topic
V2EX - 技术
V2EX - 技术
Latest news
Latest news
PCI Perspectives
PCI Perspectives
T
The Blog of Author Tim Ferriss
P
Palo Alto Networks Blog
T
Tor Project blog
Project Zero
Project Zero
云风的 BLOG
云风的 BLOG
Webroot Blog
Webroot Blog
Attack and Defense Labs
Attack and Defense Labs
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org

博客园 - -only-

FlyakiteOSX安装帮助 ubuntu安装ibus输入法 超链接样式 远程桌面登陆工具下载 Linux Yum命令(转) FLV播放器 源码二例(转) 利用FLV组件制作播放器 vsftp配置文件属性 linux下mysql远程登陆 - -only- - 博客园 在Linux下安装和使用MySQL MyEclipse注册码收集 在Flash中调用xml文档 使用FLVPlayback组件播放fms(fcs)的流式FLV文件 .Net中url传递中文的解决方案 计算器 java中的 equal 和 == 的区别 Javascript函数大全 struts标签库 Hibernate中DetachedCriteria的使用(转)
网页设计常用的Javascript特效代码
-only- · 2007-12-20 · via 博客园 - -only-

实用的JS代码片段——网页特效代码很多了,这里收集整理的是一些常规的比较实用的JS代码片断。

  字号缩放

  让文字大点,让更多的用户看的更清楚。(也可以把字体变为百分比来实现)

<script type="text/JavaScript"> 
function doZoom(size) 
{document.getElementById('zoom').style.fontSize=size+'px';} 
</script> 
<span id="zoom">需要指定大小的文字</span> 
< a href="javascript:doZoom(16)">大</a> <a href="javascript: doZoom(14)">中</a> <a href="javascript:doZoom(12)">小< /a>

  跳转菜单新窗口

<select name="select" onchange="window.open(this.options[this.selectedIndex].value)"> 
<option value="http://www.microsoft.com/ie"> Internet Explorer</option> 
<option value="http://www.microsoft.com"> Microsoft Home</option> 
<option value="http://msdn.microsoft.com"> Developer Network</option> 
</select>

  添加到收藏夹和设为首页

  添加到收藏夹

<a href="javascript:window.external.addFavorite('http://链接','说明');">添加到收藏夹</a>

  设为首页

<a href=# onclick=this.style.behavior='url(#default#homepage)';this.setHomePage ('http://链接');>设为首页</a>

  打开窗口即最大化

<script language="JavaScript">  
<!-- Begin  
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)  
// End -->  
</script>

  加入背景音乐

<bgsound src="mid/windblue[1].mid" loop="-1"> 只适用于IE 
<embed src="music.mid" autostart="true" loop="true" hidden="true">

对Netscape ,IE 都适用

  防止点击空链接时,页面往往重置到页首端

  代码“javascript:void(null)”代替原来的“#”标记,也可以用“#nogo”来代替啊?

  自动换行

 style="table-layout: fixed;WORD-BREAK: break-all; WORD-WRAP: break-word"

  只对IE有用...FF的话用overflow:hidden来解决,不至于影响美观