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

推荐订阅源

博客园 - 三生石上(FineUI控件)
G
Google Developers Blog
Vercel News
Vercel News
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
N
Netflix TechBlog - Medium
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Engineering at Meta
Engineering at Meta
B
Blog
博客园_首页
量子位
博客园 - 叶小钗
L
LangChain Blog
T
The Blog of Author Tim Ferriss
云风的 BLOG
云风的 BLOG
Blog — PlanetScale
Blog — PlanetScale
F
Fortinet All Blogs
S
SegmentFault 最新的问题
宝玉的分享
宝玉的分享
D
DataBreaches.Net
雷峰网
雷峰网
The Cloudflare Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
Last Week in AI
Last Week in AI
P
Proofpoint News Feed
TaoSecurity Blog
TaoSecurity Blog
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
The GitHub Blog
The GitHub Blog
I
Intezer
H
Help Net Security
The Hacker News
The Hacker News
The Register - Security
The Register - Security
cs.CL updates on arXiv.org
cs.CL updates on arXiv.org
AWS News Blog
AWS News Blog
V
V2EX
Microsoft Security Blog
Microsoft Security Blog
T
Tenable Blog
Spread Privacy
Spread Privacy
A
Arctic Wolf
P
Proofpoint News Feed
T
Threat Research - Cisco Blogs
Schneier on Security
Schneier on Security
C
CERT Recently Published Vulnerability Notes
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Last Watchdog
The Last Watchdog
Latest news
Latest news
T
Troy Hunt's Blog
L
LINUX DO - 热门话题

博客园 - -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来解决,不至于影响美观