Copy Code code as follows:
var example = new Fx (element,//element
{
form:{
The style before the animation
Color: "#00f",
},
to:{
Target Style
Color: "#00f",
"Background-color": "#5f5",
opacity:0.9,
},
Linear method
Look at the code, found that the jump link is used location, and the direct use of a generated link, click on the jump, but will not pop the new page.
Solve:
Through the JS script, to simulate the click of a link like this, instead of using location
In ECMAScript, all variables declared outside of a function declaration to be visible inside the function have access to their final value !
A closure function can only access the final value of a variable!!!
eg
function Fntest (arr) {for (Var i=
1. Calculate the length of a string
Copy Code code as follows:
var txt= "Hello world!"
document.write (Txt.length)
2.indexOf () method
How to use IndexOf () to position the first occurrence of a specified character in a
But what I'm going to face is a very loose HTML page that can't be XML
Therefore, the focus of this article is that if you have a table or list paragraph in the page you want to get, you need to save the paragraph's information as a column in the JS
Three pages in the same window, respectively for main.htm,left.htm and Right.htm.
Main.htm
Copy Code code as follows:
Implementation Cross
main Window
Left.htm
Copy Code code as follows:
1, hidden elements cannot get focus
2, for Div and other special elements to get focus
about element gain Focus About element Gain focus: 1, hidden elements cannot get focus There is a hidden input: solution: First show the
Copy Code code as follows:
Initialize navigation background, IFRAME container
function FNDAOHANGBG ()
{
var h = fngetheight (), w = fngetwidth ();//Get background window size
if (!$ (' DIVDAOHANGBG '))
{
var div = $C (' div ');//Create a
So, we have to use IE's currentstyle and the getpropertyvalue of the consortium to get it.
Elem.style.attr the way to get the style is not to say. First look at the Currentstyle method, which is exclusive to IE, represents the object formatting and
and Str.replace (/\-/g, "!") You can replace all the matching characters (G is the global flag).
Replace ()
The Replace () method returns the string so results when you replace text matching its-argument
(a regular expression) with the text of the
The following is the DOM structure of the page
Copy Code code as follows:
One
Two
Three
Four
Here is the JavaScript code
Copy Code code as follows:
Get an object from an ID
function ID (v)
Of course, we can get the value of the parameters in the background, and then in the foreground JS code to get the value of the variable, the specific way to refer to my article: JavaScript to get the background C # variables and invoke the
Copy Code code as follows:
Report:
Value types and reference types in JavaScript
Data type value/reference type note
Undefined value No value
Number value
Boolean value
String value strings are processed in assignment
The depressing thing comes, first look at the foreground HTML:
Copy Code code as follows:
Purchase Quantity:
Parts (stock )
Use JS to take the value, attention to see JS code:
Copy Code code as follows:
The JavaScript loader is a powerful and useful tool in WEB development. Several of the current popular loaders, such as Curljs, LABJS and Requirejs are widely used. They are powerful, but in some cases they can have simpler schemes.
If you are
JavaScript selected text cancellation, can be compatible with all major browsers:
Copy Code code as follows:
if (document.selection) {
Document.selection.empty ();
else if (window.getselection) {
Window.getselection (). Removeallranges (
Copy code code as follows:
/**
* Binary find the position of the character in the array (ordered list)
* @param array to retrieve
* @param x to check Character found
* @type int
* @returns character position in array,
I. Prototype prototype objects, the principles to be noted are:
(1). Using prototypes can substantially reduce the amount of memory that each object needs, because objects can inherit many properties.
(2). Objects can inherit these properties even
The first is more common, and is implemented accessor by closure store value, which is suitable for all browsers.
Copy Code code as follows:
Function Sandy (val) {
var value = val;
This.getvalue = function () {
return value;
}
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