featureimagezoomeratt
TRANSCRIPT
addimagezoom()functionoptionsHTMLAttribute Default Descriptionzoomrange undefined(noresizingofmagnifiedimage). Setsthezoomlevelofthemagnifiedimagerelativetotheoriginalimage.Thevalueshouldbeintheform[x,y],wherexandyareintegersthatdefinethelowerandupperboundsofthezoomlevel.Forexample:[3,3]//setsthezoomlevelto3,withnoabilitytotogglethezoomlevel[2,10]//setstheinitialzoomlevelto2,withabilitytoincreaseupto10byusingthemousewheel.Thedefaultvalueforthisoptionisundefined,whichmeansthescriptwillsimplydisplaythemagnifiedimageinitsoriginaldimensionswithnoresizing.Thelargeimageoptionbelowletsyoudefinethelargeimagethatshouldbeusedasthemagnifiedimage.
magnifiersize [200,200] Setsthemagnifyingarea'sdimensionsinpixels.Defaultis[200,200],or200pxwideby200pxtall.magnifierpos "right" Setsthepositionofthemagnifyingarearelativetotheoriginalimage.Enter"right"or"left".Defaultis"right".largeimage undefined(originalimageusedasmagnifiedimage). SpecifiesthefullpathorURLtothemagnifiedimage.Thisshouldbealarger,higherresolutionversionoftheoriginalimage,forexample:$('#image1').addimagezoom({zoomrange:[3,10],largeimage:'myimages/haydenlarge.jpg'})
Ifyouomitthezoomrangeoption,thelargeimagewillnotberesized(toapoweroftheoriginalimage).Youwoulddothiswhenthemagnifiedimageisalreadyatthemagnificationlevelyouwant:
$('#image1').addimagezoom({largeimage:'https://reader015.{domain}/reader015/html5/0505/5aedd68350aa9/5aedd684e90db.jpg'})
NoticethatIleftoutthe"zoomrange"option,whichcausesthenaturaldimensionsofthelargeimagetobeused,withnoresizing.Thedefaultvalueforlargeimageisundefined,whichcausesthescripttosimplyusetheoriginalimageasthemagnifiedimageaswell.Inthiscaseyou'llwanttomakesurezoomrangeisdefinedsothemagnifiedimageisenlargedinsomeway:
$('#image1').addimagezoom({zoomrange:[5,5]})
curshadev1.5
false Booleanthatwhensettotrueshowsamagnifyinglensontopofthethumbnailimagewhilethemouseisoverit.Defaultisfalse.cursorshadecolorv1.5
"#fff" HTMLcolorstringthatsetsthebackgroundcolorofthemagnifyinglens.cursorshadeopacityv1.5
0.3 Decimalvaluethatsetsthedegreeofopacityofthelens,where1isfullyopaque(asifnoopacityisapplied),and0.1isalmosttransparent.