Js control ctrl + p

Source: Internet
Author: User

1. How to display the content in LI with ellipsis after the content length exceeds
<Style type = "text/css">
<! --
Li {
Width: 200px;
White-space: nowrap;
Text-overflow: ellipsis;
-O-text-overflow: ellipsis;
Overflow: hidden;
}

-->
</Style>
<Ul>
<Li> <a href = "#"> Satan's Law on the way to the foot of Lhasa bean curd </a> </li>
</Ul>

2. Right-click the screen and evaluate the shortcut keys

<Body oncontextmenu = "return false" onkeydown = "bodyOnKeyDown ()">
Function bodyOnKeyDown (){

Var actObjTagName = "";
Var actObjType = "";
Try {
ActObjTagName = document. activeElement. tagName. toLowerCase ();
ActObjType = document. activeElement. type. toLowerCase ();
} Catch (e ){
}
/*
// ENTER-> TAB
If (event. keyCode = 13 &&
ActObjType! = "Button "&&
ActObjType! = "Submit "&&
ActObjType! = "Reset "&&
// ActObjType! = "Textarea "&&
ActObjTagName! = ""){
Event. keyCode = 9;
}
*/

// Function Key
If (event. ctrlKey ){
If (event. keyCode = 78 | // CTRL + N
Event. keyCode = 87 | // CTRL + W
Event. keyCode = 69 | // CTRL + E
Event. keyCode = 73 | // CTRL + I
Event. keyCode = 79 | // CTRL + O
Event. keyCode = 80 | // CTRL + P
Event. keyCode = 76 | // CTRL + L
Event. keyCode = 72 | // CTRL + W
Event. keyCode = 66) {// CTRL + B
Event. keyCode = 0;
Event. returnValue = false;
}
}

If (event. keyCode >=112 & // F1, F12
Event. keyCode <= 123 ){
Event. keyCode = 0;
Event. returnValue = false;
}

If (event. keyCode = 27) {// ESC
Event. keyCode = 0;
Event. returnValue = false;
}

If (event. keyCode = 8) {// Backspace
If (actObjType! = "Text "&&
ActObjType! = "Textarea "&&
ActObjType! = "Password "&&
ActObjType! = "File "){
Event. keyCode = 0;
Event. returnValue = false;
}
}

}

Reprinted: http://www.blogjava.net/hotcup/archive/2006/12/04/85425.aspx

JS tips: http://www.blogjava.net/hotcup/archive/2006/09/17/70103.html

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.