Practical JavaScript page Special effects instance code fragment

Source: Internet
Author: User
Tags window
javascript| Special Effects | Web pages |

Broadcast: A practical JS code fragment--Web page special effects code a lot, here to collect and collate some of the conventional more practical JS code snippets.

  Font size Scaling

Make the text larger, so that more users see more clearly. (You can also change the font to a percentage)

<script type= "Text/javascript" >
function Dozoom (size)
{document.getElementById (' Zoom '). style.fontsize=size+ ' px ';}
</script>
<span id= "Zoom" > need to specify the size of the text </span>
<a href= "Javascript:dozoom" > Big </a> <a href= "Javascript:dozoom ()" > </a> <a href= " Javascript:dozoom () > Small </a>

  Jump Menu New Window

<select name= "Select" >
<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>

  Add to Favorites and set as Home page

Add to Favorites

<a href= "javascript:window.external.addFavorite (' http://link ', ' description ');" > Add to Favorites </a>

Set as homepage

<a href=# onclick=this.style.behavior= ' url (#default #homepage) '; this.sethomepage (' http://link ');> Set as homepage </a >

  To open a window is to maximize

<script language= "JavaScript" >
<!--Begin
Self.moveto (0,0)
Self.resizeto (Screen.availwidth,screen.availheight)
End-->
</script>

  Add background music

<bgsound src= "Mid/windblue[1].mid" loop= "-1" > only applies to IE
<embed src= "Music.mid" autostart= "true" loop= "true" hidden= "true" > for Netscape, IE all apply

  Prevents clicking on the empty link, the page is often reset to the top end of the page

The code "javascript:void (NULL)" Instead of the original "#" tag, you can use the "#nogo" to replace AH?

  Wrap Line

Style= "table-layout:fixed; Word-break:break-all; Word-wrap:break-word "

Only for IE useful ... FF words with Overflow:hidden to solve, not affect the beautiful



Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.