[jquery plug-in] plug-in, image preloading, adaptive wide and wide picture slide, autoimgv1.1
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]