Summary of common tips for webpage code page 1/3

Source: Internet
Author: User

1. Make the browser window never show a scroll bar.

<Body style = "overflow-x: hidden; overflow-y: hidden"> or <body style = "overflow: hidden"> or <body scroll = no>
2. No horizontal scroll bar
<Body style = "overflow-x: hidden">
3. No vertical scroll bar
<Body style = "overflow-y: hidden">
2. How to shake the image.
<SCRIPT language = javascript1.2>
<! --
Var rector = 2
Var stopit = 0
Var a = 1
Var count = 0
Function init (which ){
Stopit = 0
Shake = which
Shake. style. left = 0
Shake. style. top = 0
}
Function rattleimage (){
If ((! Document. all &&! Document. getElementById) | stopit = 1 | count = 100)
Return
Count ++
If (a = 1 ){
Shake. style. top = parseInt (shake. style. top) + rector
}
Else if (a = 2 ){
Shake. style. left = parseInt (shake. style. left) + rector
}
Else if (a = 3 ){
Shake. style. top = parseInt (shake. style. top)-rector
}
Else {
Shake. style. left = parseInt (shake. style. left)-rector
}
If (a <4)
A ++
Else
A = 1
SetTimeout ("rattleimage ()", 50)
}
Function stoprattle (which ){
Stopit = 1
Count = 0
Which. style. left = 0
Which. style. top = 0
}
// -->
</SCRIPT>
<Style>. shakeimage {POSITION: relative}
</Style>


4. How to add colors to the horizontal line in DW.

If this setting is not available in DW, you can only add the code in HTML:    
5. How can I enable full-screen flash playback on a webpage?

You only need to set the WIDTH and HEIGHT parameters to 100% in the HTML of the swf File. Of course, you can also set them in the settings of the HTML File exported from Flash by opening the File menu; select Publish Settings to bring up the export Settings dialog box. In the Dimensions option under the HTML Tag, select Percent (percentage) from the drop-down list, and enter 100 in the WIDTH and HEIGHT boxes. that's all.

6. Why can't I find the Flash animation I inserted in DW!

Restart and restart the computer. Now IE6 has bound this program.

7. In Flash, if the right mouse button is blocked? What do FS commands mean?

Fscommand ("fullscreen", "true/false"); (full screen setting, TRUE on, FALSE off)
Fscommand ("showmenu", "true/false"); (right-click menu settings, TRUE display, FALSE Do Not Display)
Fscommand ("allowscale", "true/false)
Fscommand ("trapallkeys", "true/false"); (shortcut key setting, TRUE shortcut key on, FALSE shortcut key off)
Fscommand ("exec"); (called by the EXE program)
Fscommand ("quit"); (exit to close the window)

8. What is an invisible button in Flash.

Use the hit frame in the button to create a button that is completely transparent only in the sensing area.

9. How to link Flash animation.

Dreamweaver cannot create a link for Flash. You can only add a link with geturl () in Flash, and then insert it into Dreamweaver.

10. layer skills in DW.

Layers can be nested. I personally give you a tip. In the layer panel, press CTRL and drag and drop the layer to where you want to become its child layer, I think this is the simplest and most intuitive method.

11. How can I change the shape of the mouse?

CSS style panel in Dreamweaver4:
Press CTR + SHIFT + E -- In the displayed style sheet dialog box, click NEW, And the edit dialog box appears. In the last extensions-cursor on the left, select the pointer format you want to change, apply the style sheet where you want to change it. If the whole page is added to <body bgcolor = "#003063" text = "# ffffff" id = all>.
<Span style = "cursor: x'> example </span>
Here (text) is selected as the object, and you can change it to another one, such as link.
X can be equal to = hand, crosshair (Cross), text (text cursor), wait (as the name suggests), default (default effect), help (question mark) e-size (right arrow), ne-resize (right arrow), nw-resize (left arrow), w-resize (left arrow) sw-resize, s-resize, se-resize, and auto ).

12. Use CSS as a stamp. Check it out!

<Input type = button value = do I look like a stamp? Style = "height: 80px; border: 2px dashed # cccccc">


13. Friends who frequently access the Internet may have visited such websites. when they enter the home page, a window will pop up immediately. How can this problem be solved!

This javascript code can be used to extract the blue forum.
[1. The most basic pop-up window Code]
In fact, the code is very simple:
<Script language = "javascript">
<! --
Window. open ('page.html ')
-->
</SCRIPT>
Because it is a piece of javascripts code, should they be put? Lt; script language = "javascript"> tag and </script>. <! -- And --> are used for some earlier browsers, and the code in the labels is not displayed as text in these old browsers. This is a good habit.
Window. open ('page.html ') is used to control the pop-up window page.html. If page.html is not in the same path as the main window, the path, absolute path (http: //), and relative path (../) should be specified before. You can use single quotes and double quotes, but do not mix them.
This piece of code can be added to any location of HTML, between [2. After setting, the pop-up window is displayed]
Let's talk about the settings in the pop-up window. You just need to add something to the code above.
We will customize the appearance, size, and position of the pop-up window to adapt to the specific situation of the page.
<Script language = "javascript">
<! --
Window. open ('page.html ', 'newwindow', 'height = 100, width = 400, top = 0, left = 0, toolbar = no, menubar = no, scrollbars = no, resizable = no, location = no, status = no ')
// Write a row
-->
</SCRIPT>
Parameter description:
<Script language = "javascript"> the js SCRIPT starts;
Window. open command to pop up a new window;
'Page.html 'name of the pop-up window;
'Newwindow' indicates the name of the pop-up window (not the file name). It is optional and can be replaced by null;
Height = 100 window height;
Width = 400 window width;
Top = the pixel value between the 0 window and the top of the screen;
Left = 0 the pixel value between the window and the left of the screen;
Toolbar = no indicates whether to display the toolbar. yes indicates display;
Menubar and scrollbars indicate the menu bar and scroll bar.
Resizable = no: whether to change the window size. yes: yes;
Location = no indicates whether the address bar is displayed. yes indicates yes;
Status = no whether to display the information in the status bar (usually the file has been opened), yes is allowed;
</SCRIPT> end of js SCRIPT
[3. Function Control pop-up window]
The following is a complete code.
<Html>
<Head>
<Script LANGUAGE = "javascript">
<! --
Function openwin () {window. open ("page.html", "newwindow", "height = 100, width = 400, toolbar =
No, menubar = no, scrollbars = no, resizable = no, location = no, status = no ")
// Write a row
}
// -->
</Script>
</Head>
<Body onload = "openwin ()">
... Any page content...
</Body>
</Html>
A function openwin () is defined here, and the function content is to open a window. There is no purpose before calling it.
How to call it?
Method 1: <body onload = "openwin ()"> A window pops up when the browser reads the page;
Method 2: <body onunload = "openwin ()"> A window pops up when the browser leaves the page;
Method 3: call with a connection:
<A href = "#" onclick = "openwin ()"> open a window. </a>
Note: "#" is a virtual connection.
Method 4: call with a button:
<Input type = "button" onclick = "openwin ()" value = "open window">


14. No table is used for writing. Let's take a look. Nothing.

<Html>
<Head>
<Title> Jiangnan Lotus fan surface </title>
<Meta http-equiv = "Content-Type" content = "text/html; charset = gb2312">
<Style type = "text/css">
<! --
. Font1 {font-size: 12px; color: #999999; text-decoration: none}
A {font-size: 12px; color: #999999; text-decoration: none}
A: hover {font-size: 12px; color: #000000; text-decoration: none}
-->
</Style>
</Head>
<Body bgcolor = "# FFFFFF" text = "#000000">
<Div class = "font1" style = "writing-mode = tb-rl; height: 200px" width = 300>
<P> Shang Tao in midsummer
<P> <a href = "index.htm"> yuan yunfu, yellow powder, with one-night dew marks </a>
<P> Wang Jinling, Xin Liang, yaochi, last night
<P> A white lotus flower opens Wu guannan at will
<P> Xin Yu yingqiu xiangmantang Qi Xinmin
<P> qixiangqi Simin
<P> Qinglian, Lu shile
</Div>
</Body>
</Html>

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.