[jquery plug-in] plug-in, image preloading, adaptive wide and wide picture slide, autoimgv1.1

time:10-09-23 forum:HTML web page, JS language and code
  Reproduced from http://www.im286.com/thread-5120043-1-1.html

Function Description:
1. can make a page multiple calls of
2., the width of the image played by
2., the adaptive external framework
3. can customize the playback time interval
4. compatibility IE6. IE7 Br />
* jQuery plug-in: autoimg

* version: v1.1

* time: 2010-8-31

*

--------------------------------------------------------------------
* L templates are as follows:

.Lt; div class=.quot; autoimg.quot;.Gt;

.Lt; div. Pg.quot; /.gt;.Lt; /li.gt;

.Lt; li.gt;.Lt; img src=.quot. .gt;.Lt; /div.gt;

.Lt; /div.gt;

*3. reference style.#91; see examples: index.html.#93; />
height:300px;

width:300px;

border:1px solid #000;

> />
}

.Imglist Li {

width:80px;

height:80px;
> St Li img {

width:80px

}

.Clearboth {

/>jQuery.fn.autoimg = function (G) {



var interval = new Array (). R />
};

$.extend (D, G)



/ / >. //frameimg = framediv.children (.Quot; img.quot;);

frameimg = $(.Quot;.Lt; img /.gt;.Quot;); />
imgwrap = $(EL).Children (.Quot; ul.quot;).Children (.Quot; li.quot;);

/ / / / / / / / > Height ()}, {.quot; w.quot; 64,.Quot; h.quot; 64});

frameimg.css ({width:64, height:64, marginLeft:imgMargins.l, > / / / / / / / / / >

framediv.loadthumb ({parentDiv:framediv, frameimg:frameimg, img:firstimg});

$.imgSlide (EL, I); / / / / / / / > > > / > Ord.#91; i.#93; = 0;

interval.#91; i.#93; setInterval (function) {$.interval (EL, I, ord.#91; > >). Var imgSrc, imgLength, I;



framediv = $(EL).Children (.Quot;); );

imgwrap = $(EL).Children (.Quot; ul.quot;).Children (.Quot; li.quot;);

> > = > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > / > Framediv.loadthumb ({parentDiv:framediv, frameimg:frameimg, img:imgwrap.find (.Quot; img.quot;).Eq (J)});

}

>
}

/ / / / / / / / / / / / / / / / / > jQuery.fn.loadthumb = function (D) {

var imgTmp. {},

frameimg: {}

}, D);

D.frameimg.hide ();

imgTmp = = = {}; ImgDem.w = imgTmp.width;

imgDem.h = imgTmp.height;

imgDem = $.imgResize. ImgMargins = $.imgCenter ({.quot; w.quot; D.parentDiv.width (),.Quot; h.quot; D.parentDiv.height ()}, {.quot; w.quot; imgDem.w,.Quot; .t})

.Attr (.Quot; src.quot; D.img.attr (.Quot; src.quot;))

.FadeIn. S.src) should be placed behind load,





/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / .w.gt; 0.Amp;.Amp; imgDem.h.gt; 0) {

var rate = (parentDem.w/imgDem.w.Lt; parentDem.h/imgDem.h)? ParentDem.w/imgDem.w:parentDem.h/imgDem.h; if the specified height / picture height is less than the specified width / picture width, then, The number of proportions is given the height of the specified height / picture.

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / /

if (rate.Lt; = 1) {

imgDem.w = imgDem.w*rate; / / / / / / / a new width = width =

}else{// if the ratio is greater than 1, then the new width equals the previous width.

imgDem.w = imgDem.w;

}

if (rate.Lt; = 1) {
{= > > > / > Else{

imgDem.h = imgDem.h;

}

}

return imgDem; the picture is horizontally in the parent element, perpendicular to the parent element. ImgDem is a picture)

jQuery.imgCenter = function (parentDem, imgDem) {

var left =.

}

/ / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / / >

jQuery.imgHover = function (EL, I) function (EL, I) {

.children (.Quot; div.quot;);

frameimg = framediv.children (.Quot; img.quot;);

0. />


El.Children (.Quot; ul.quot;).Children (.Quot; li.quot;).Hover ();

clearInterval (interval.#91; i.#93;);

}, function () {

ord.#91; i.#93; dollars (dollars)) 1; Interval.#91; i.#93; = setInterval (function () {$.interval (EL, I, ord.#91; i.#93;)}, D.delay*1000);

}; R / > $.imgHover (this, I);

};

}; [/code]

online demo address: [/b]
[url=http://www.ffasp.com/plugs/autoimg/: free space download site [containing demo] Rayfile.com/zh-cn/files/4c8ce1a1-c240-11df-bd3e-0015c55db73d/: 1xxtk1nz]http://www.rayfile.com/zh-cn/fil... -bd3e-0015c55db73d/[/url:1xxtk1nz]

prev:The sixth census of Ji'nan was formally ... next:The happy mid autumn festival in the res...
post comment
Notice



approved   The inheritance of the old Ji'nan ha...   Do not belittle those street cars, t...   South Korea's chief mother is popula...   The 3 year old was elected the young...   The Qilu Public Welfare Alliance has...
rand   Prevent other people from saving web...   5 debug skills necessary for JavaScr...   Several common JavaScript obfuscatio...   CSS tutorial PDF format books   HTML5 finalization 1st anniversary y...
ads

other

Because all the contents of this site are reproduced from other media, the intention is to provide free services to the public, but it does not mean that this site agrees with its views, and can not be responsible for the authenticity of its verification, such as the copyright unit or individual of the manuscript does not want to publish on this site, please Contact me, I will immediately remove it, thank you. Contact: atseashawk@163.com