There are onmouseleave and onmouseenter in IE, and it's a headache for web developers who want to be compatible with the big browsers.
Although there are some tricks on the internet for Mozilla Firefox, the amount of code is not optimistic.
Want to
This event is different under standard and IE. Firefox is implemented according to the standard, the event called "Dommousescroll", ie under the use of "MouseWheel".
Of course, one line of code solves the compatibility problem
Copy Code code as
If you don't consider encapsulating the entire code, you can write a similar effect in about 5 minutes, in order to encapsulate the entire code as an object, using a little bit of the style of the examples in the pro Javascript techniques
Today found a JS to put on the top of the Phpcms! But his code is like this.
Copy Code code as follows:
var titles = ' Top 1| 2| Create top 3| 4 ';
var imgs= ' {App_path}cdstyle/images/image1.jpg|
Effect:
Let's take a look at what other sites do:
Google.com Login: Both the client and server side are authenticated, and the information is prompted as
baidu.com Login: Shielded password input box
Http://fanfou.com/register: Both the client and
As we all know, a JS code ends with a semicolon and ends with a carriage return that works in the browser (at least in my IE7). Do not know if this is the characteristics of the JS language or only the fault-tolerant function of the interpreter?
Using the Split () method
Cases:
New Document &L T;/body>
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
Run the output result is
A
C
D
E
We say that the invocation pattern of a function is called as a function to distinguish it from the other three invocation patternsfunction other three kinds of calls: Method invocation mode, constructor invocation pattern, Apply/call invocation
1 2 3 4
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
The second way, the idea is the same as the first
Copy Code code as follows:
//preview function
var colorid= "
Untitled document &l T;div > Kunshan Forum "New World Army" Corps glimpse 2 009 year Kunshan Third foot general Meeting Kun altar member photo Kun altar member gathers Yangchenghu picnic activities Kun altar Chorus "loving
(function ($) {}) (JQuery);
In fact, it is relatively simple to understand several concepts:
1, (), in JavaScript () indicates the execution of a method, such as:
function X () {
Alert ("xxx");
}
var a = x; No call, A is a function
var a =
Everyone has seen a certain degree of malicious ads, you shut up and out again! Why, JS to tell you
Html
can not be closed to the bomb frame, can't kill the cockroach!
call
Express message
Css
layer hides and displays 2009-7-7 More I am more content inside I am not more content
[Ctrl + A All SELECT Note: If the need to introduce external JS need to refresh to perform]
For example, we define a classroom object, where we set an event that triggers an event onfull when the classroom person increases by more than 60 people:
Copy Code code as follows:
var classroom=function ()
{
this.numberofpeople=0;
1. The definition of the number of cycles is placed outside the circulation body: this seems to be the same for all languages, and is more and more evident in the 100 elements. In other words, modifying the for (Var i=0;i=0;i--). I found that there
Escape () method:The specified string is encoded using the ISO Latin character set. All spaces, punctuation, special characters, and other non-ASCII characters will be converted into%XX-formatted character encodings (XX equals the encoded 16 digits
Code Listing 1-1 shows examples of javascript variable scopes
Set global variable foo, and place as "test"
var foo = "Test";
In the IF block
if (true) {
Place Foo as ' new test '
var foo = "New test";
}
As we can see, Foo is now equal to ' new test '
function BeginDrag (elementtodrag,event)
{
var =event.clientx-parseint (elementToDrag.style.left);
var deltay=event.clienty-parseint (elementToDrag.style.top);
The deltax/y here is actually the difference between the coordinates of the mouse and the
Using sort () bubble sort:
var arr = [5,39,8,1,2,13,55];
arr = Arr.sort (function (a,b) {return a-b});
Do not declare a third variable bubble sort:
The first layer traverses the number of arrays (how many times to traverse), the
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