Home > Web Front-end > JS Tutorial > Summary of common JS code examples_javascript skills

Summary of common JS code examples_javascript skills

PHP中文网
Release: 2016-05-16 18:54:35
Original
1235 people have browsed it

1. Keyboard direction key listening events and prohibiting copy operations

<head> 
<script language=javascript> 
document.onkeydown=nextpage 
var prevpage="http://www.jb51.net/1.htm" 
var nextpage="http://www.jb51.net/2.htm" 
var indexpage="/readindex/index_0011020986.html" 
function nextpage(event) { 
event = event ? event : (window.event ? window.event : null); 
if (event.keyCode==13) location=indexpage 
if (event.keyCode==37) location=prevpage 
if (event.keyCode==39) location=nextpage 
} 
</script> 
<SCRIPT language=javascript> 
function nocopy() 
{ 
alert("不允许复制"); 
event.returnValue=false; 
} 
</SCRIPT> 
</head> 
<body leftmargin="0" oncopy=nocopy()> 
<script language="JavaScript" type="text/JavaScript"> 
<!-- 
function MM_openBrWindow(theURL,winName,features) { //v2.0 
window.open(theURL,winName,features); 
} 
//--> 
</script> 
<h1>禁止复制</h1> 
</body>
Copy after login


jquery table operation example. I originally wanted to add it to the message, but the administrator of javaeye is very old inexplicably. It's to hide my post. It was hidden by the judges less than a minute after it was posted. I really admire it. In other words, it was hidden by everyone. Hahaha, where did I post a spam post? I posted it this morning. Prototype's lightboxhuanchengjquery's fancybox So I posted a post, but who knows, the post will be hidden by the judges. Is it possible that you can post emotional posts without hiding them, but post technical posts and they will be hidden!!!

Copy code The code is as follows:


//Rendering of table in Thailand climate
BEUI.E.thailand_QH = function(){
//The first column in tbody is on the left, and the fonts in columns 3, 5, and 7 are bold
$('table#thailand-qh tbody tr').each(function(){
$('td: even',this).css('font-weight','bold');
$('td:eq(0)',this).css({'text-align':'left',' font-weight':'normal'});
});
$('table#thailand-qh tbody tr:odd').addClass('thailand-qh-tbody-tr-odd');
$('table#thailand-qh tbody tr:even').addClass('thailand-qh-tbody-tr-even');
};


Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Articles by Author
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template