




已阅读5页,还剩3页未读, 继续免费阅读
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
JS Plugs Learning NOTEBOOK2013/10/25 by OU KinSei1. lightbox_meFiles: jquery.lightbox_mev_1.jsPlug Name: Lightbox_meHome: http:/buckwilson.me/lightboxme/Download: /buckwilson/Lightbox_me/zipball/masterApi: http:/buckwilson.me/lightboxme/Introduce: Lightbox_me is an essential tool for the jQuery developers toolbox. Feed it a DOM element wrapped in a jQuery object and it will lightbox it for you, no muss no fuss.Lightbox_me handles all of those annoying edge cases that other lightbox solutions do not: Handles overlay resize when the window is resized Handles overlay size in cases where the document is smaller than the window Handles position: fixed in all browsers Position: fixed automatically swaps to position: absolute when the window size is smaller than the modal, so the user can scroll to see the contentsIn addition its got these other nice features: Tiny footprint (just over 1000 bytes gzipped & compressed) Small DOM overhead (adds 1 DOM element for the overlay) Dynamic iFrame shim is created and destroyed for the IE 6 select box peek issue (tested and working on https pages) Supports IE 6+, Firefox 2.5+, Safari, Chrome (havent tested in Opera yet)Usage:Include jQuery and lightbox_me in your web page, then invoke lightbox_me on a jQuery object:$(domobj).lightbox_me();or$(#id).lightbox_me();This will lightbox the DOM element immediately. Typically you would put this code inside the click handler of another element.1.This is a typical use-case for a modal: a sign in sheet. Create the sign in sheet in your document, then set it todisplay: none;, then attach a click handler to the item you want to invoke the sign in sheet:$(#try-1).click(function(e) $(#sign_up).lightbox_me( centered: true, onLoad: function() $(#sign_up).find(input:first).focus() ); e.preventDefault();); Be sure and resize the browser height and scroll around to observe the various cases outlined above.2.Triggering a closeYou can manually trigger a close event by calling .trigger(close) on the element you have lightboxed. For example:$ele.lightbox_me();$ele.trigger(close);3Triggering a repositionRepositioning happens on window resize or scroll, but sometimes you may need to trigger it manually. Call .trigger(reposition); on the element you have lightboxed. For example:$ele.lightbox_me();$ele.trigger(reposition);Options:OptionDefaultDescriptionappearEffectfadeInThe appear effect jQuery is to use on the modal.appearEaseThe easing effect jQuery is to use on the modal. (requiresjQuery easing)overlaySpeed300The time it takes (in ms, or slow, normal, fast) for the overlay to fade in.lightboxSpeedfastThe time it takes (in ms, or slow, normal, fast) for the lightbox modal to animate in.closeSelector.closeThe jQuery selector (in string format) you want lightbox_me to bind the close event to.closeClicktrueWhether or not to close the lightbox with the user clicks the overlay.closeEsctrueWhether or not to close the lightbox when the user presses escapedestroyOnClosefalseWhether or not to destroy the DOM element that has been lightboxed when the user closes it (this option is good if youre using ajax to create the DOM)showOverlaytrueWhether or not to show an overlay when presenting the modal.onLoadfunction() Function to call when the lightbox is completely open (after animation)onClosefunction() Function to call when the lightbox is completely closed (after animation)classPrefixlbThe class to prefix the overlay CSS classzIndex999The base zIndex for the overlay. The iframe shim is this + 1, the modal is this + 2centeredfalseWhether or not the modal is centered verticallymodalCSStop: 40pxCSS applied to the modal when lightbox_me is run. If you specify a top it will be overridden ifcenteredis set totrueoverlayCSSbackground: black,opacity: .6CSS applied to the overlay when lightbox_me is run.2. swfobjectFiles: swfobject.jsPlug Name: swfobjectHome: /p/swfobject/Download: /p/swfobject/downloads/listApi: /p/swfobject/wiki/apiIntroduce: Embedding Adobe Flash Player content用法:html部分.js部分 swfobject.embedSWF(test.swf, swf1, 300, 120, 9.0.0,);源码部分:这是2.2中的源码。看参数就明白怎么使用了。embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) .详解首先需要了解object标签。/tags/tag_object.asp/tags/tag_param.aspswfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr这些依次为,swf位置,html要替换成flash的元素的id,宽,高,flash版本,如果没有flash那就使用这个自动安装flash的文件 swfobject2.2源文件里有flashvarsObj:这里是flashvars的值。这个常用来作为html与flash之间传递参数,本来是在params对象中的属性,由于考虑到常用和方便,所以单独取了出来。可以设置为null。然后在param中写。param对象的属性:详细的介绍/cps/127/tn_12701.htmlplay,loop,menu,quality,scale,salign,bgcolor,base,swliveconnect,flahvars,devicefont ,allowscriptaccess ,seamlesstabbing ,allowfullscreen ,allownetworkingwmode 这个很重要,window,opaque,transparent(一般设为transparent透明或者opaque不透明)。当不设置时默认为window,这时已窗口方式呈现。这时object元素将始终显示在最上面,同时点击事件等也监听不到。attributes对象的属性:id,name,styleclass(不使用class,因为class也是ECMA4的保留关键字),aligncallbackFn:回调函数使用演示演示1swfobject.embedSWF(test6_flashvars.swf, content5, 300, 120, 6.0.0, expressInstall.swf, name1:hello,name2:world,name3:foobar, menu:false, id:dynamicContent5,name:dynamicContent5);演示2var flashvars = name1: hello, name2: world, name3: foobar;var params = menu: false;var attributes = id: dynamicContent2, name: dynamicContent2;swfobject.embedSWF(test6_flashvars.swf, content2, 300, 120, 6.0.0, expressInstall.swf, flashvars, params, attributes);演示3var flashvars = ; flashvars.xmlPath = data.xml; var params = ; params.wmode = transparent; var attributes = ; swfobject.embedSWF(xixi.swf,banner,960,250,9.0.0,expressInstall.swf,flashvars,params,attributes);演示4swfobject.embedSWF(gen_shu.swf, gen_swf1, 180, 105, 9.0.0,null,null,wmode:transparent,null,function()alert(已加载成功flash);js调用方法/p/swfobject/wiki/api3. mousewheelFiles: jquery.mousewheel.min.jsPlug Name: swfobjectHome: /mousewheel/ , /brandonaaron/jquery-mousewheelDownload: /brandonaaron/jquery-mousewheel/tagsApi: /brandonaaron/jquery-mousewheelIntroduce: A jQuery plugin that adds cross-browser mouse wheel support.Usage:In order to use the plugin, simply bind themousewheelevent to an element. It also provides two helper methods c
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 蒸汽清洗机项目安全评估报告
- 小学历史文化兴趣小组活动计划
- 交通运输安全生产工作年度计划
- 整形机构项目安全风险评价报告
- 湘教版一年级美术与手工结合计划
- 2025年北汽福田汽车股份有限公司校园招聘模拟试题a4版
- 2025年珠宝制造市场调查报告
- 2025年中国醋酸甲酯项目投资计划书
- 高端住宅精装修客户满意度提升措施
- 幼儿园大班科学《榕树的根》课件
- 淘宝网-信息披露申请表
- 小微型客车租赁经营备案表
- 教育培训机构办学许可证申请书(样本)
- 瓷砖业务员提成方案
- 2022年一级注册计量师案例分析真题
- “三级”安全安全教育记录卡
- 爱莲说-王崧舟
- 小微企业信用评级标准模板
- 车辆安全设施设备定期检查台账
- 超危大工程实施指导手册宣贯
- 人教版小学五年级数学竞赛试题及答案
评论
0/150
提交评论