Web design commonly used technique (under)

21. A pop-up window so that always at the top:
<body the onblur = "this.focus ();">

22. Do not scroll bar?
Let bars do not:
<body style = "overflow: the Scroll; the y-overflow-: hidden">
</ body>
Let no bar:
<body style = "overflow: the Scroll; overflow-the X-: hidden ">
</ body>
both removed? More simple
<body Scroll = "NO">
</ body>

23. How to remove the image link click, the dotted line around the picture?
<a href="#" onFocus="this.blur()"> <img src = " / blog / logo.jpg" border = 0> </a>

24. The mail processing submit the form
<form name = "form1" Method, = "POST" Action = " mailto:. @ *** **** COM " enctype = "text / Plain">
<= the INPUT of the type the Submit>
< / form>

25. In the child window open to refresh the parent window in the code how to write?
window.opener.location.reload ()

26. How to set the page size to open the
<body onload = "top.resizeTo (300,200 );">
open position page <body onload = "top.moveBy (300,200 );">

27. How to add a background picture is not paved on the page, the page is pulled background Fixed
<the STYLE>
body
NO-REPEAT;:; background-REPEAT URL (/blog/logo.gif): {background-Image
background- position: Center; background-Attachment: Fixed}
</ the STYLE>

28. Check whether a string consisting entirely of the digital
<Script Language = "Javascript"> <-!
Function the checkNum (STR) {return str.match (// D /) == null}
Alert (the checkNum ( "1,232,142,141" ))
Alert (the checkNum ( "123214214a1"))
// -> </ Script>

29. The size of the window to get a
document.body.clientWidth; document.body.clientHeight

30. how to determine whether a character
if (/[^/x00-/xff]/g.test(s)) alert ( "contains Chinese characters");
the else Alert ( "all characters");

How 31.TEXTAREA adaptive number of text lines
<TextArea rows. 1 = 27 name = S1 = Onpropertychange cols = "this.style.posHeight = this.scrollHeight">
</ TextArea>

32. The date minus the number of days equal to the second date
<Script Language = Javascript>
function CC (dd, dadd)
{
// add error processing may
var A = new new a Date (dd)
A = a.valueOf ()
A = A - 24-dadd * 60 * 60 * 1000 *
A = new new a Date (A)
Alert (a.getFullYear () + "of" + (a.getMonth () + 1 ) + " month" + a.getDate () + " day ")
}
CC (" 12/23/2002 ", 2)
</ Script>

33. 选择了哪一个Radio
<HTML><script language="vbscript">
function checkme()
for each ob in radio1
if ob.checked then window.alert ob.value
next
end function
</script><BODY>
<INPUT name="radio1" type="radio" value="style" checked>Style
<INPUT name="radio1" type="radio" value="barcode">Barcode
<INPUT type="button" value="check" onclick="checkme()">
</BODY></HTML>

34.脚本永不出错
<SCRIPT LANGUAGE="JavaScript">
<!-- Hide
function killErrors() {
return true;
}
window.onerror = killErrors;
// -->
</SCRIPT>

35.ENTER keys allow the cursor to the next input frame
<INPUT onKeyDown = "IF (== 13 is event.keyCode) = event.keyCode. 9">

36. A detection of a site link speed:
The following code is added <body > area:
<Script Language = Javascript>
Tim. 1 =
the setInterval ( "Tim ++", 100)
B =. 1
var autourl the Array = new new ()
autourl [. 1] = " www.njcatv.net "
autourl [2] = "Javacool .3322.net "
autourl [. 3] =" www.sina.com.cn "
autourl [. 4] =" www.nuaa.edu.cn "
autourl [. 5] =" www.cctv.com "
function Butt () {
document.write ( "<form name = autof is run>")
for (var. 1 = I; I <autourl.length; I ++)
document.write ( "<input type=text name=txt"+i+" size=10 value="/blog/测试中......>" =》<input type=text
name=url"+i+" size=40> =》<input type=button value=GO

onclick=window.open(this.form.url"+i+".value)><br/>")
document.write("<input type=submit value=刷新></form>")
}
butt()
function auto(url)
else

b++
}
function run(){for(var i=1;i<autourl.length;i++)document.write("<img src=http://"+autourl+"/"+Math.random()+" width=1 height=1

onerror=auto("http://"+autourl+"")>")}
run()</script>

37. A variety of styles cursor
auto: standard cursor
default: standard arrow
hand: hand cursor
wait: wait cursor
text: I cursor
vertical-text: horizontal I-beam
no-drop: not drag the cursor
not-allowed: Invalid Cursor
help:? help cursor
all-scroll: triangle direction indicator
move: mobile standard
crosshair: cross standard
E-a resize
n-a resize-
NW-a resize
W a resize-
S-a resize
SE-a resize
SW-a resize

38. The effects of entry and exit pages
into the page <meta http-equiv = "Page -Enter" content = "revealTrans (duration = x, transition = y)">
launch page <meta http-equiv = "Page -Exit" content = "revealTrans (duration = x,  transition = y)">
this is some of the effects when the page is loaded and recall. duration represents the duration of the effects, in seconds. indicates what type of transition effects to use, a value of 1-23:























39. In a predetermined time jump
<META http-equiv = V = "REFRESH" content = "5; URL = http: //www.williamlong.info">

40. whether the page is retrieved
<meta name = "ROBOTS" content = " attribute value">
  in which the property values are some of the following:
  property value is "all": files will be retrieved, and the link to the page can be inquiries;
  property value "none": file not be retrieved, but not the query link on the page;
  attribute value of "index": files will be retrieved;
  attribute value of "follow": links on the query page;
  property value "noindex": file do not search, but may be queried link;
  property value is "nofollow": file not be retrieved, but can be found at the link on the page.

最大化窗口?
<script language="JavaScript">
<!--
self.moveTo(0,0)
self.resizeTo(screen.availWidth,screen.availHeight)
//-->
</script>

 


Solve the problem: since the priority between the layer and the drop-down box are: drop-down box> layer, when displayed, because the order of priority the problems as described above occur. (If several elements are layers, we can set the z-index attribute layer) solution is: to put a layer in the drop-down box higher priority than the elements (iframe), so as to solve this problem! Specific solutions codes are as follows:

<div id="menu" style="position:absolute; visibility:hidden; top:20px; left:20px; width:100px; height:200px; background-color:#6699cc;">
<table>
  <tr><td>item 1</td></tr>
  <tr><td>item 2</td></tr>
  <tr><td>item 3</td></tr>
  <tr><td>item 4</td></tr>
  <tr><td>item 5</td></tr>
  </table>
  <iframe src="/blog/javascript:false" style="position:absolute; visibility:inherit; top:0px; left:0px; width:100px; height:200px; z-index:-1; filter='progid:DXImageTransform.Microsoft.Alpha(style=0,opacity=0)';"></iframe>
</div>

<a href="#" onclick="document.getElementById('menu').style.visibility='visible'">menu</a>

<form>
  <select><option>A form selection list</option></select>
</form>

输入框也可以做的很漂亮了
<div align="center"><input type="hidden" name="hao" value="yes">
              外向数:<input
      name=answer
      style="color: rgb(255,0,0); border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1px solid rgb(192,192,192)">
             没回答的题数:<input
      name=unanswer id="unanswer"
      style="color: rgb(255,0,0); border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1px solid rgb(192,192,192)">
            <br/>
            总得分:
            <input
      name=score id="score"
      style="color: rgb(255,0,0); border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1px solid rgb(192,192,192)">
             结    论:
            <input
      name=xgjg id="xgjg"
      style="color: rgb(255,0,0); border-left: medium none; border-right: medium none; border-top: medium none; border-bottom: 1px solid rgb(192,192,192)">
            <br/>
            <br/>
           
            <input onClick=processForm(this.form) style="FONT-FAMILY: 宋体; FONT-SIZE: 9pt" type=button value=查看结果 name="button">
             <input type="reset" name="Submit" value="重做">
            </div>
注意:修改<body> is a <body onload = "max.Click ()"> is the maximum open

The window, and if instead <body onload = "min.Click ()"> becomes the window to open a minimized

<object id="min" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
            <param name="Command" value="Minimize">
          </object> <object id="max" type="application/x-oleobject" classid="clsid:adb880a6-d8ff-11cf-9377-00aa003b7a11">
            <param name="Command" value="Maximize">
          </object>
</body>

Automatic page refresh (description)

When you do web pages, are not you sometimes want to keep your pages automatically refresh, or over a period of time automatically jump to another page of your own set? In fact, to achieve this effect is very simple, and this effect can not be called even special effects. You just put the following code on your web pages on it.

1, the automatic refresh page: The following code to <head> region <meta http-equiv = "refresh" content = "20">, wherein 20 refers to the page refresh every 20 seconds.

2, page automatically jump: the following code to <head> region <meta http-equiv = "refresh " content = "20; url = http: //www.williamlong.info">, where the spacer 20 refers to 20 seconds after the jump to http://www.williamlong.info page.

Page automatically shut down

5000 refers to the time <body onLoad = "setTimeout (window.close, 5000)">

Pop-up window automatically closes

10 seconds after the pop-up window closes automatically

Note: In the new body to be added tan.htm <the onLoad = "closeit ()">
head

<script language="JavaScript">

<!--

var gt = unescape('%3e');

was pop = null;

var over = "Launch Pop-up Navigator";

popup = window.open('', 'popupnav', 'width=225,height=235,resizable=1,scrollbars=auto');

if (popup != null) {

if (popup.opener == null) {

popup.opener = self;

}

popup.location.href = 'tan.htm';

}

// -->

</ Script>
<body> Note: The code is in the new file
<script language = "JavaScript">

 function closeit()

 </script>

This is not the <iframe> (reference) Yeah. It is called directly. The following code was added <body> region

<object type="text/x-scriptlet" width="800"  height="1000" data="../index.htm">
</object>

Reproduced in: https: //www.cnblogs.com/majinyu/archive/2007/04/02/696560.html

Guess you like

Origin blog.csdn.net/weixin_33755557/article/details/93666455