Common JS Functions

Source: Internet
Author: User
Function mm_swapimgrestore () {// V3.0 var I, X, A = document. mm_sr; for (I = 0; A & I <. length & (x = A [I]) & X. osrc; I ++) X. src = x. osrc;} function mm_preloadimages () {// V3.0 var d = document; if (D. images) {If (! D. mm_p) d. mm_p = new array (); var I, j = D. mm_p.length, A = mm_preloadimages.arguments; for (I = 0; I <. length; I ++) if (a [I]. indexof ("#")! = 0) {d. mm_p [J] = new image; D. mm_p [J ++]. src = A [I] ;}}function mm_findobj (n, d) {// v4.01 var P, I, X; If (! D) d = document; if (P = n. indexof ("? ")> 0 & parent. frames. Length) {d?parent.frames=n.substring(p=1}}.doc ument; n = n. substring (0, P);} If (! (X = d [N]) & D. All) x = D. All [N]; for (I = 0 ;! X & I <D. Forms. length; I ++) x = D. Forms [I] [N]; for (I = 0 ;! X & D. Layers & I <D. layers. length; I ++) xw.mm_findobj(n,d.layers+ I }.doc ument); If (! X & D. getelementbyid) x = D. getelementbyid (n); Return X;} function mm_swapimage () {// V3.0 var I, j = 0, x, A = mm_swapimage.arguments; document. mm_sr = new array; for (I = 0; I <(. length-2); I + = 3) if (x = mm_findobj (A [I])! = NULL) {document. mm_sr [J ++] = x; If (! X. osrc) X. osrc = x. SRC; X. src = A [I + 2];}

 

 
This is generated automatically by Dreamweaver for script interaction.CodeThe first function is to assign the src attribute to the Image array stored in document. mm_sr, which is equivalent to loading the image. The second function is to pre-load images. The function parameter is multiple image addresses. The third function is to find a specified Dom node. n is the node name, D is the fourth function referenced by the parent node for image switching.

Source: http://zhidao.baidu.com/question/133223207.html

Contact Us

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

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.