




已阅读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年大学出入境管理专业题库- 多边合作与边境管理机制研究
- 企业制度与政策管理手册编写标准
- 高校教师资格证之《高等教育法规》试题(得分题)及答案详解(网校专用)
- 2025年上半年黑龙江中医药大学佳木斯学院招聘工作人员(9人)模拟试卷含答案详解(培优)
- 2025年度国家康复辅具研究中心附属康复医院社会公开招聘笔试高频难、易错点备考题库带答案详解
- 2024计算机二级过关检测试卷及参考答案详解(综合卷)
- 2025年云南省贵金属新材料控股集团有限公司校园招聘笔试备考试题附答案详解(典型题)
- 2025年国家电网招聘考试高分题库含答案详解(巩固)
- 2024年计算机操作员题库试题附参考答案详解(完整版)
- 2024宁波市公务员行测带答案详解(突破训练)
- 2025年职业病诊断医师资格考试复习卷及答案
- 人教版四年级数学上册 第八单元 优化 田忌赛马 课件
- 端子拉力测试标准
- 公司标准化室管理制度
- 2025年安徽省网络和数据安全职业技能大赛(数据安全管理员)备赛试题库(含答案)
- 教育部幼儿园入学准备教育指导要点
- 中华诗词大赛小学4-6真题题库及答案
- 2024中级审计师考试要点试题及答案
- 融资租赁信用评估体系构建-全面剖析
- 职业健康检查质量管理工作手册
- 2025年网络安全检查整改报告
评论
0/150
提交评论