First of all, the Framework used is of course my Framework mass Framework. Of course, you can use other frameworks, such as jQuery. There is nothing complicated. As long as you understand the principle, you can make it all at once. Presumably, you
Simply put, the context of function execution is changed, which is the most basic usage. The basic difference between the two methods is that parameter passing is different.Call (obj, arg1, arg2, arg3); call the first parameter to pass the object,
First, the position of this element is fixed.Top is (clientHeight-elem.offsetHeight)/2 (that is, the element is in the middle of the browser, this is fixed)Left is (clientWidht-subject width)/2 + Subject width + left margin. The left margin can be
1. offset OffsetWidth: the space occupied by the element in the horizontal direction, including the border and the width of the scroll bar.OffsetHeight: the space occupied by the element in the vertical direction, including the border and the height
First look at the interface code:Copy codeThe Code is as follows:Select the car type: The ToolTip of the DropDownList control attribute is converted to the Title. The value of the title can be used as the prompt information for the required
There are many methods added to String. prototype, but they are roughly divided into the following categories:
Category
Method Name
Original capability enhancement
Strip|Include|StartsWith|EndsWith|Empty|Blank
Format
IntroductionThe Module mode is a very common mode in JavaScript programming. Generally, everyone knows the basic usage. This article attempts to give you more advanced usage of this mode.First, let's take a look at the basic features of the Module
PrefaceIn this chapter, we will explain part 1 of The Five Principles of S.O.L. I. D: Implementation of The JavaScript language, and The Principle of Open and Closed OCP (The Open/Closed Principle ).The opening/closing principle is described as
In this example, the color is used as an example to provide users with automatic prompts, display results and running results.
1. Establish a framework structure:
Copy codeThe Code is as follows:
Color:
2. Page and form CSS:
Copy
Execute in the following format:Copy codeThe Code is as follows:D. wait (3000). run (function (m) {// wait 3 secondsAlert ('mountain previously ');}). Wait (1000). run (function (m) {// wait 1 secondAlert ('Temple in the mountains ');}). Wait (2000).
This time, I will mainly share some special effects on images that I personally think are shocking, including jQuery, CSS3, cute crow animations, and simple picture playing animations, of course, you may have seen it, but it doesn't matter. You can
Initialize two variables first. Note the nuances:Copy codeThe Code is as follows:Var a = $ (' ');Var B = $ (' ');// You cannot simply use $ ('') Because jQuery has optimized it. Copy codeThe Code is as follows:Typeof a [0]; // 'object'Typeof B [0]; /
Requirement problem: I wanted to find a js Code on the Internet, but I found that it was either too complicated, difficult to control, or not compatible ......Problem Analysis: find that the best is the best.Solution: you can write a calendar by
1. innerHTMLEveryone must be familiar with this, read and write, and modify the element content quickly and conveniently. For compatibility issues, refer to a knowledge record in W3Help.2. outerHTMLThis method can be used to quickly Replace the
1. The same domain name and other requests can be the sameJs:Copy codeThe Code is as follows:Var url = "http: // localhost: 2589/a. ashx ";$ (Function (){$. GetJSON (url, function (data ){Alert (data. Name );})}); The server returns a string:{"Name":
Add:To disable moving of selected text, FF can set CSSXxxx {-moz-user-select: none ;}Other browsers can setXXXX. onselectstart = function () {return false}One implementation principle is to create a placeholder element (or copy a target element,
Copy codeThe Code is as follows:// Html structure to string format display support line feedFunction ToHtmlString (htmlStr ){Return toTXT (htmlStr). replace (/\ \; | \ R \ n | \ n/g, " ");}// Html structure to string displayFunction toTXT (str
1. Obtain the next element of the current element.Copy codeThe Code is as follows:Function getNextElement (node ){If (node. nodeType = 1 ){Return node;}If (node. nextSibling ){Return getNextElement (node. nextSibling );}Return null;}; 2. Add 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