Special Effect webpage code

Source: Internet
Author: User

Controls the display and hiding of horizontal and vertical scroll bars
<Body style = "overflow-Y: hidden"> remove the horizontal scroll bar.
<Body style = "overflow-X: hidden"> remove the vertical scroll bar.
<Body scroll = "no"> NO scroll bar is displayed.
---- Next wonderful Code Section ----------------------------------------------------------------------------
Point to table color
<TD onmouseover = "This. style. backgroundcolor = '# ffff'" onmouseout = "This. style. backgroundcolor ='' "style =" cursor: Hand ">
---- Next wonderful code snippet ----------------------------------------------------------------------------
Common IFRAME page
<IFRAME name = "name" src = "main.htm" width = "450" Height = "287" scrolling = "Auto" frameborder = "0"> </iframe>
---- Next wonderful code snippet ----------------------------------------------------------------------------
IFRAME adaptive height
<IFRAME name = "pindex" src = "index. ASP "frameborder = false scrolling =" Auto "width =" 100% "Height =" 100% "frameborder = No onload =" document.allpolic'pindex').style.height?pindex.doc ument. body. scrollheight "> </iframe>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Change to your own icon in front of the IE address bar to display your icon in favorites
<LINK rel = "shortcut icon" href = "favicon. ICO">
<LINK rel = "bookmark" href = "favicon. ICO">
---- Next wonderful code snippet ----------------------------------------------------------------------------
Font Size Selection
<SCRIPT type = "text/JavaScript">
Function dozoom (size)
{Document. getelementbyid ('zoom '). style. fontsize = size + 'px ';}
</SCRIPT>
<Span id = "zoom"> text to be specified </span>
<A href = "javascript: dozoom (16)"> large </a> <a href = "javascript: dozoom (14) "> medium </a> <a href =" javascript: dozoom (12) "> small </a>
---- Next wonderful code snippet ----------------------------------------------------------------------------
How to block Div with select
Add the following code to the DIV and adjust it as needed.
<IFRAME src = "javascript: false" scrolling = "no" frameborder = "0" style = "Z-index:-1; position: absolute; top: 5px; left: 2px; width: 168; Height: 100px; ">
</Iframe>
---- Next wonderful code snippet ----------------------------------------------------------------------------
IFRAME (embedded frame) Adaptive height
The entered embedded address must be on the same site as the current page. Otherwise, the system will prompt "Access Denied !". You have permission for cross-Origin references. For more information, see.
<IFRAME name = "Guestbook" src = "Guestbook/index. ASP "scrolling = no width =" 100% "Height =" 100% "frameborder = No onload =" document.all+'guestbook').style.height#guestbook.doc ument. body. scrollheight "> </iframe>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Flash transparent options
<Param name = "wmode" value = "Transparent">
---- Next wonderful code snippet ----------------------------------------------------------------------------
Add to favorites and set as Homepage
<A href = # onclick = "this. style. behavior = 'url (# default # homepage) '; this. setHomePage ('HTTP: // www.zuoxinwu.com/'); "> set as homepage </a>
<A href = "javascript: window. External. AddFavorite ('HTTP: // www.zuoxinwu.com/', 'xin's network logs ')"> Add your site to favorites </a>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Record and display the last modification time of the webpage
<Script language = JavaScript>
Document. Write ("Last Update time:" + document. lastmodified + "")
</SCRIPT>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Holiday countdown
<Script language = "JavaScript">
VaR TimeDate = new date ("febrary 17,2007 ");
VaR times = "New Year's Eve ";
VaR now = new date ();
VaR date = TimeDate. gettime ()-Now. gettime ();
VaR time = math. Floor (Date/(1000*60*60*24 ));
If (Time> = 0)
Document. Write ("now" + times + "and:" + time + "day ")
</SCRIPT>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Add it to the head to disable caching.
<Meta http-equiv = "expires" content = "0">
<Meta http-equiv = "cache-control" content = "no-Cache">
<Meta http-equiv = "Pragma" content = "no-Cache">
---- Next wonderful code snippet ----------------------------------------------------------------------------
Make the background of documents in the IFRAME framework transparent
<IFRAME src = "about: <body style = 'background: transparent'>" allowtransparency> </iframe>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Maximize when a window is opened
<Script language = "JavaScript">
<! -- Begin
Self. moveTo (0, 0)
Self. resizeTo (screen. availwidth, screen. availheight)
// End -->
</SCRIPT>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Add background music
<Bgsound src = "mid/music. Mid" loop = "-1"> only applicable to IE
<Embed src = "music. Mid" autostart = "true" loop = "true" hidden = "true"> applicable to both Netscape and IE
---- Next wonderful code snippet ----------------------------------------------------------------------------
Scroll
<Marquee direction = up Height = 146 onmouseout = start () onmouseover = stop () scrollamount = 2> scroll Information
</Marquee>
---- Next wonderful code snippet ----------------------------------------------------------------------------
When you click an empty link, the page is often reset to the header.
The Code "javascript: void (null)" replaces the original "#" mark
---- Next wonderful code snippet ----------------------------------------------------------------------------
Text or image pop-up window of the specified size, add it to the body
<Script language = "JavaScript" type = "text/JavaScript">
Function mm_openbrwindow (theurl, winname, features) {window. Open (theurl, winname, features );}
</SCRIPT>
Pop-up code
<A href = "#" target = "_ Self" onclick = "mm_openbrwindow('windows.html ','', 'width = 550, Height = 380 ') "width =" 550 "Height =" 380 "border =" 0 "> image or text </a>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Flash button and link
On (Press ){
Geturl ("http://www.zuoxinwu.com % 22, % 22_blank /");
}
---- Next wonderful code snippet ----------------------------------------------------------------------------
Code for automatic page Jump at fixed time
<Meta http-equiv = "refresh" content = "5; url = http://www.zuoxinwu.com">
---- Next wonderful code snippet ----------------------------------------------------------------------------
Line separation line
<HR noshade size = 0 color = # c0c0c0>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Automatic line feed in Web pages
<TD style = "word-break: Break-all">.
Complete is
Style = "table-layout: fixed; Word-break: Break-all; Word-wrap: Break-word"
---- Next wonderful code snippet ----------------------------------------------------------------------------
Remove the image toolbar that automatically appears in IE6 and set the galleryimg attribute to false or no.

---- Next wonderful code snippet ----------------------------------------------------------------------------
Prohibit copying and dragging and selecting
<Body ondragstart = Window. event. returnvalue = false oncontextmenu = Window. event. returnvalue = false onselectstart = event. returnvalue = false>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Prohibit page body content from being selected
<Body oncontextmenu = "Return false" ondragstart = "Return false" onselectstart = "Return false" onselect = "document. selection. empty () "oncopy =" document. selection. empty () "onbeforecopy =" Return
False "onmouseup =" document. selection. Empty () ">
---- Next wonderful code snippet ----------------------------------------------------------------------------
You cannot right-click or copy it without pressing CTRL +!
<Body oncontextmenu = "window. event. returnvalue = false"
Onkeypress = "window. event. returnvalue = false"
Onkeydown = "window. event. returnvalue = false"
Onkeyup = "window. event. returnvalue = false"
Ondragstart = "window. event. returnvalue = false"
Onselectstart = "event. returnvalue = false">
</Body>
---- Next wonderful code snippet ----------------------------------------------------------------------------
IE browser does not scroll the background:
<Body background = "Image File" bgproperties = "fixed">
---- Next wonderful code snippet ----------------------------------------------------------------------------
Random conversion of background images (a special effect that refreshes the mood)
<Script language = "JavaScript">
Image = new array (4); // defines the image as an array of the number of images.
Image [0] = 'tu0.gif '// path of the background image
Image [1] = 'tu1.gif'
Image [2] = 'tu2.gif'
Image [3] = 'tu3.gif'
Image [4] = 'tu4.gif'
Number = math. Floor (math. Random () * image. Length );
Document. Write ("<body background =" + image [number] + "> ");
</SCRIPT>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Loading video in Flash
On (Release)
{
Loadmovie ("f1.swf", "_ root. loaderclip ");
}
---- Next wonderful code snippet ----------------------------------------------------------------------------
Image form button
<Form ID = "form1" name = "form1" method = "Post" Action = "">

</Form>
---- Next wonderful code snippet ----------------------------------------------------------------------------
CSS definition method for Left and Right shadow backgrounds
Body {
Text-align: center;
Background-repeat: Repeat-y;
Background-position: center;
Background-image: URL (../images/bg0.jpg );
}
---- Next wonderful code snippet ----------------------------------------------------------------------------
How to close a Layer
<Div id = "layer1"> </div>
<A href = "#" onclick = "layer1.style. Display = 'none'"> close layer </a>
---- Next wonderful code snippet ----------------------------------------------------------------------------
If the text is too long, the excessive text will be displayed as a ellipsis.
<Div style = "width: 120px; Height: 50px; Border: 1px solid blue; overflow: hidden; text-overflow: ellipsis;">
<Nobr> for example, a row of text is long and cannot be displayed in a table. </nobr>
</Div>
---- Next wonderful code snippet ----------------------------------------------------------------------------
If the text is too long, the part exceeding the set length is omitted.
<Div style = "width: 120px; Height: 50px; Border: 1px solid blue; overflow: hidden; text-overflow: Clip;">
<Nobr> for example, a row of text is long and cannot be displayed in a table. </nobr>
</Div>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Automatically maximized after entering the home page
<SCRIPT>
Self. moveTo (0, 0)
Self. resizeTo (screen. availwidth, screen. availheight)
</SCRIPT>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Sunken text
<Div style = "width: 300px; padding: 20px; overflow: hidden; Word-wrap: Break-word; Word-break: Break: All; font-size: 12px; line-Height: 18px; Background-color: # eeeeee; ">
<Font disabled>
How are you doing? <Br>
Don't you want to try it? <Br>
<A href = "http://www.zuoxinwu/"> small New Network Log </a> </font>
</Div>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Run code box
<SCRIPT>
Function Preview ()
{
VaR testwin = open ('');
Testwin.doc ument. Write (code. value );
}
</SCRIPT>
<Textarea id = Code Cols = 60 rows = 15> </textarea>
<Br>
<Button onclick = Preview ()> RUN </button>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Link a table
<Table width = "100%" onclick = "window. Open ('HTTP: // www.zuoxinwu.com/',' _ blank ')" style = "cursor: Hand">
<Tr>
<TD Height = "100" bgcolor = "f4f4f4"> & nbsp; </TD>
</Tr>
</Table>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Make the pop-up window always at the top
<Body onblur = "This. Focus ();">
---- Next wonderful code snippet ----------------------------------------------------------------------------
CSS text shadow
. Shadowfont {filter: dropshadow (color = #666666, offx = 1, offy = 1, positive = 1); font-family: ""; font-size: 9pt; color: # ffffff ;}
---- Next wonderful code snippet ----------------------------------------------------------------------------
Back & Close Window
Back Page: javascript: history. Back (1 );
Back Page: javascript: history. Back ();
Back one page: javascript: history. Go (-1 );
Two pages back: javascript: history. Go (-2 );
Close the current window: javascript: window. Close ();
---- Next wonderful code snippet ----------------------------------------------------------------------------
Table transparency
Style = "filter: alpha (opacity = 72 )"
---- Next wonderful code snippet ----------------------------------------------------------------------------
How to prevent others from placing your webpage in the framework
<Script language = "JavaScript">
<! --
If (self! = Top)
{
Top. Location = self. location;
}
-->
</SCRIPT>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Differences between ALT and title in prompts
ALT is used to prompt the image; title is used to prompt the link text or common text.
<A href = "#" Title = "text prompt for Link"> text </a>
<P Title = "text prompt for Link"> text </P>

---- Next wonderful code snippet ----------------------------------------------------------------------------
Try to use external calls for all JavaScript calls.
<Script language = "JavaScript" src = "JS/a1.js"> </SCRIPT>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Link Method
Response. Redirect "login. asp"
Location. href = "login. asp"
Onclick = "window. Location = 'login. asp '"
Onclick = "window. Open ('login. asp ')"
---- Next wonderful code snippet ----------------------------------------------------------------------------
Basic link Style
A: link indicates the link style.
A: active indicates the style of the current active connection.
A: hover indicates an outdated mouse style.
A: visited indicates the connection style that has been accessed.
"Link-visited-hover-active" Fixed sequence is simplified to "lvha", that is, "love" + "hate"
---- Next wonderful code snippet ----------------------------------------------------------------------------
Set the style of different text links on the same page
<Style type = "text/CSS">
. Green {color: #309633}
. Green A: link {color: #309633; text-Decoration: None}
. Green A: visited {color: #309633; text-Decoration: None}
. Green A: hover {color: #309633; text-Decoration: underline}
. Green A: Active {color: #309633; text-Decoration: None}
</Style>
<A href = "#" class = "green"> text </a>
---- Next wonderful code snippet ----------------------------------------------------------------------------
Drop-down navigation menu
<Select name = select onchange = "javascript: window. Open (this. Options [This. selectedindex]. Value)" style = "color: #096">
<Option> ---- select ---- </option>
<Option value = "http://www.cnblogs.com/myssh"> small New Network Log </option>
<Option value = "http://www.cnblogs.com/myssh"> xi you story Network </option>
</SELECT>

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.