Controls the display and hiding of horizontal and vertical scroll bars?
<Body style = "overflow-Y: hidden"> remove the X axis.
<Body style = "overflow-X: hidden"> remove the Y axis.
<Body scroll = "no"> hide
Table color change
<TD onmouseover = "This. style. backgroundcolor = '# ffff '"
Onmouseout = "This. style. backgroundcolor = ''"
Style = "cursor: Hand">
Prohibit copying, drag and select
<Body ondragstart = Window. event. returnvalue = false oncontextmenu = Window. event. returnvalue = false onselectstart = event. returnvalue = false>
Common IFRAME page
<IFRAME name = "name" src = "main.htm" width = "450" Height = "287" scrolling = "Auto" frameborder = "0"> </iframe>
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>
Change to your own icon in front of the IE Address Bar & your icon can be displayed in favorites
<LINK rel = "shortcut icon" href = "favicon. ICO">
<LINK rel = "bookmark" href = "favicon. ICO">
Font size scaling
More and more people are making a bubble for a long time, and the penetration rate of glasses is getting higher and higher, which makes the text bigger and clearer to more users.
<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>
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>
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 = "gbook/index. ASP "scrolling = no width =" 100% "Height =" 100% "frameborder = No onload =" document.all+'guestbook').style.height#guestbook.doc ument. body. scrollheight "> </iframe>
New jump menu window
<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>
Flash transparent options
<Param name = "wmode" value = "Transparent">
Add to favorites and set as Homepage
<A href = # onclick = "this. style. behavior = 'url (# default # homepage) '; this. setHomePage ('HTTP: // www.makewing.com/lanren/'); "> set as homepage </a>
<A href = "javascript: window. External. AddFavorite ('HTTP: // www.makewing.com/lanren/', 'Lazy library ')"> Add to favorites </a>
Record and display the last modification time of the webpage
<Script language = JavaScript>
Document. Write ("Last Update time:" + document. lastmodified + "")
</SCRIPT>
Holiday countdown
<Script language = "JavaScript">
VaR TimeDate = new date ("October 1,2002 ");
VaR times = "National Day ";
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>
Add to head
Disable caching
<Meta http-equiv = "expires" content = "0">
<Meta http-equiv = "cache-control" content = "no-Cache">
<Meta http-equiv = "Pragma" content = "no-Cache">
Make the background of documents in the IFRAME framework transparent
<IFRAME src = "about: <body style = 'background: transparent'>" allowtransparency> </iframe>
Maximize when a window is opened
<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 applicable to IE
<Embed src = "music. Mid" autostart = "true" loop = "true" hidden = "true"> applicable to both Netscape and IE
Scroll
<Marquee direction = up Height = 146 onmouseout = start () onmouseover = stop () scrollamount = 2> scroll Information
</Marquee>
When you click an empty link, the page is often reset to the header.
The Code "javascript: void (null)" replaces the original "#" mark
Text or image pop-up window of the specified size
Add in 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('windows01.htm','', 'width = 550, Height = 380 ') "width =" 550 "Height =" 380 "border =" 0 "> image or text </a>
Flash button and link
On (Press ){
Geturl ("http://www.makewing.com", "_ blank ");
}
Jump Page code
<Meta http-equiv = "refresh" content = "5; url = http://www.makewing.com">
Line separation line
<HR noshade size = 0 color = # c0c0c0>
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"
Remove the image toolbar that automatically appears in IE6 and set the galleryimg attribute to false or no.
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 () ">
You cannot right-click it, or press Ctrl + A to copy it!
<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>
Internet Explorer supports a body attribute bgproperties, which can prevent the background from rolling:
<Body background = "Image File" bgproperties = "fixed">
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>
Loading video in Flash
On (Release)
{
Loadmovie ("1-01.swf", "_ root. loaderclip ");
}
Image form button
<Form ID = "form1" name = "form1" method = "Post" Action = "">
</Form>
CSS definition method for Left and Right shadow backgrounds
Body {
Text-align: center;
Background-repeat: Repeat-y;
Background-position: center;
Background-image: URL (../images/bg.jpg );
}
Move the mouse over the link
Style = "cursor: hand"
How to close a Layer
<Div id = "layer1"> </div>
<A href = "#" onclick = "layer1.style. Display = 'none'"> close layer </a>
Close Window script
<A href = javascript: Close ()> [close the window] </a>
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>
Automatically maximized after entering the home page
<SCRIPT>
Self. moveTo (0, 0)
Self. resizeTo (screen. availwidth, screen. availheight)
</SCRIPT>
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.lenvo.cn/"> www.lenvo.cn </a> </font>
</Div>
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>
Link a table
<Table width = "100%" onclick = "window. Open ('HTTP: // www.makewing.com/',' _ blank ')" style = "cursor: Hand">
<Tr>
<TD Height = "100" bgcolor = "f4f4f4"> & nbsp; </TD>
</Tr>
</Table>
Make the pop-up window always at the top
<Body onblur = "This. Focus ();">
CSS text shadow
. Shadowfont {filter: dropshadow (color = #666666, offx = 1, offy = 1, positive = 1); font-family: ""; font-size: 9pt; color: # ffffff ;}
Back & Close Window
Back: javascript: history. Back (1)
Close: javascript: window. Close ();
Table transparency
Style = "filter: alpha (opacity = 72 )"
How to prevent others from placing your webpage in the framework
<Script language = "JavaScript"> <! -- If (self! = Top) {top. Location = self. Location;} --> </SCRIPT>
Differences between ALT and title
ALT is used to prompt the image. Title is used to prompt link text or common text.
<A href = "#" Title = "link text prompt"> text </a>
<P Title = "link text prompt"> text </P>
Try to use external calls for all JavaScript calls.
<Script language = "JavaScript" src = "JS/XXXXX. js"> </SCRIPT>
Link
Response. Redirect "login. asp"
Location. href = "XX. asp"
Onclick = "window. Location = 'login. asp '"
Onclick = "window. Open ('')"
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" is simplified to "lvha", that is, "love" + "hate"
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>
Drop-down navigation menu
<Select name = select onchange = "javascript: window. Open (this. Options [This. selectedindex]. Value)" style = "color: #333">
<Option> ---- select ---- </option>
<Option value = "http://www.makewing.com/lanren/"> lazy gallery </option>
<Option value = "http://www.makewing.com/store/"> makewing store </option>
<Option value = "http://www.izhu.com/"> love candle net </option>
</SELECT>
Empty two cells in the first line
Style = "text-indent: 24px;" The Em unit is used to indent the first line.
The words exceeding the limit are omitted... Replace
Style = "width: 220px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis ;"
<Div style = "width: 200px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; Border: 1px solid #336699"> try again. I know the previous section, add... actually not. Check the effect. </div>