JS (JavaScript) to learn more about the j 9 (updating ...)

1. Animated

(1) Css style provides sports

Transition of property transition   is called the transition from one situation to another situation

Transition:attr  time  linear  delay

Attr is changing property

Time is the time it takes to

Linear speed of change

Delay is delayed

Review background: url () no-repeat 50% 50% red;

Background-image

Background-repeat

Background-position

Background-color

(2) Js movement provided

 

Elements of client offset scroll three series

 

clientWidth/clientHeight/clientTop/clientLeft

 

offsetWidth/offsetHeight/offsetLeft/offsetTop/offsetParent

 

scrollWidth/scrollHeight/scrollTop/scrollLeft

Thirteen attributes, the foregoing is a read-only attribute, scrollTop and scrollLeft are i.e., readable and writable

Gets the browser of body attributes are compatible

Var dd=document.body||document.documentElement

scrollTop and scrollLeft minimum value is 0

Get body height of the entire document

 

document.body.scrollHeight||document.documentElement.scrollHeight

Get a high browser screen ( browser viewing area )

Document.body.clientHeight||document.documentElement.clientHeight

Window two events in

 

onscroll when the scroll bar to scroll when the trigger

 

onresize  when the window changes trigger

 

BOM browser object model

1.window.open(url,ways)

url is open the web address

ways to open the way _self

2.window.close()

3. The browser user information

window.navigator

4. browser's address information

window.location

5.window.history record browser access history

window.history.forward () forward the latest access records

window.history.back ()   returns

 

Analytic functions

 

If his function as a function of view, can only play a mean function can be encapsulated.

 

If we look at the function as a function object, you can achieve some inherited.

 

Can console dir (fn)

Can be found in natural objects with prototype chain function call (), apply (), bind () three methods.

These three methods can be varied within the function this point

A.Call (B, C, D) . B substituents of A in the this , then the B to the call

function add(a,b){

console.log(this)

return a+b

}

function jian(a,b){

return a-b

}

// add(5,3)

var s=add.call(jian,5,6)

console.log(s)

jian add replaced in this, and then add to calls

Call and apply a difference

 

case study

Math.max (34,, 45,6,12) find the maximum term of these figures, but the argument must be a number.

Now we have a arr = [24,25,56,5] want math to find the largest item inside

var s=Math.max.apply(null,arr)

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/zff123/p/10044912.html