欢迎来到天天文库
浏览记录
ID:236089
大小:249.36 KB
页数:19页
时间:2017-07-11
《JQuery标签的使用-毕业论文外文翻译》由会员上传分享,免费在线阅读,更多相关内容在学术论文-天天文库。
1、外文文献:DOMwithjQueryutilityfunctions—UsingthejQueryflags6.1UsingthejQueryflagsSomeoftheinformationjQuerymakesavailabletousaspageauthors,andevenpluginauthors,isavailablenotviamethodsorfunctionsbutaspropertiesdefinedon$.Manyoftheseflagsarefocusedonhelpingusdivinethecapabilitiesofthecurren
2、tbrowser,butothershelpuscontrolthebehaviorofjQueryatapage-globallevel.ThejQueryflagsintendedforpublicuseareasfollows:$.fx.off—Enablesordisabledeffects$.support—Detailssupportedfeatures$.browser—Exposesbrowserdetails(officiallydeprecated)Let’sstartbylookingathowjQueryletsusdisableanima
3、tions.6.1.1DisablinganimationsTheremaybetimeswhenwemightwanttoconditionallydisableanimationsinapagethatincludesvariousanimatedeffects.Wemightdosobecausewe’vedetectedthattheplatformordeviceisunlikelytodealwiththemwell,orperhapsforaccessibilityreasons.Inanycase,wedon’tneedtoresorttowrit
4、ingtwopages,onewithandonewithoutanimations.Whenwedetectwe’reinananimation-adverseenvironment,wecansimplysetthevalueof$.fx.offtotrue.Thiswillnotsuppressanyeffectswe’veusedonthepage;itwillsimplydisabletheanimationofthoseeffects.Forexample,thefadeeffectswillshowandhidetheelementsimmediat
5、ely,withouttheinterveninganimations.Similarly,callstotheanimate()methodwillsettheCSSpropertiestothespecifiedfinalvalueswithoutanimatingthem.UsingthejQueryflagsOnepossibleuse-caseforthisflagmightbeforcertainmobiledevicesorbrowsersthatdon’tcorrectlysupportanimations.Inthatcase,youmightw
6、anttoturnoffanimations19sothatthecorefunctionalitystillworks.The$.fx.offflagisaread/writeflag.Theremainingpredefinedflagsaremeanttoberead-only.Let’stakealookattheflagthatgivesusinformationontheenvironmentprovidedbytheuseragent(browser).6.1.2DetectinguseragentsupportThankfully,almostbl
7、issfully,thejQuerymethodsthatwe’veexaminedsofarshieldusfromhavingtodealwithbrowserdifferences,evenintraditionallyproblematicareaslikeeventhandling.Butwhenwe’retheoneswritingthesemethods(orotherextensions),wemayneedtoaccountforthedifferencesinthewaysbrowsersoperatesothattheusersofourex
8、tensi
此文档下载收益归作者所有