??xml version="1.0" encoding="utf-8" standalone="yes"?>精品久久一区二区三区蜜桃,91欧美激情一区二区三区成人,亚洲精选久久http://www.aygfsteel.com/libin2722/category/31506.html虚其心,可解天下之问Q专其心Q可d下之学;静其心,可悟天下之理Q恒其心Q可成天下之业?/description>zh-cnMon, 09 Dec 2013 12:02:16 GMTMon, 09 Dec 2013 12:02:16 GMT60Ajax Session Timeout 时 处理http://www.aygfsteel.com/libin2722/articles/407255.htmlC物C物Thu, 05 Dec 2013 08:11:00 GMThttp://www.aygfsteel.com/libin2722/articles/407255.htmlhttp://www.aygfsteel.com/libin2722/comments/407255.htmlhttp://www.aygfsteel.com/libin2722/articles/407255.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/407255.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/407255.html * Author : Larry Li
 * Date : 2013-12-5
 * Email : larry.li@aicent.com
 */
var Session = function() {
    var defaults = {
            title        : 'Session Notification',
            message      : 'Your session is about to expire.',
            keepAliveUrl : '/admin/session/keep-alive',
            redirUrl     : '/account/timed-out',
            logoutUrl    : '/account/logout',
            warnAfter    : 900000, // 15 minutes
            redirAfter   : 1200000 // 20 minutes
    };
    
    var o = defaults, dialogTimer, redirTimer;
    
    var controlRedirTimer = function(action) {
        switch(action) {
            case 'start':
                // Dialog has been shown, if no action taken during redir period, redirect
                redirTimer = setTimeout(function(){
                    window.location = o.redirUrl;
                }, o.redirAfter - o.warnAfter);
                break;
    
            case 'stop':
                clearTimeout(redirTimer);
                break;
            case 'restart':
                clearTimeout(redirTimer);
                redirTimer = setTimeout(function(){
                    window.location = o.redirUrl;
                }, o.redirAfter - o.warnAfter);
                break;
        }
    };
    
    var controlDialogTimer = function(action) {
        switch(action) {
            case 'start':
                dialogTimer = setTimeout(function(){
                    $('#sessionTimeout-dialog').modal('show');
                    controlRedirTimer('start');
                }, o.warnAfter);
                break;
            case 'stop':
                clearTimeout(dialogTimer);
                break;
            case 'restart':
                clearTimeout(dialogTimer);
                dialogTimer = setTimeout(function(){
                    $('#sessionTimeout-dialog').modal('show');
                    controlRedirTimer('restart');
                }, o.warnAfter);
                break;
        }
    };
    
    var doKeepAlive = function() {
        $.ajax({
            type: 'POST',
            url: o.keepAliveUrl,
            success: function() {
                // Stop redirect timer and restart warning timer
                controlRedirTimer('restart');
                controlDialogTimer('restart');
            }
        });
    };
    
    return {
        sessionTimeout: function(options) {
            if ( options ) { o = $.extend( defaults, options ); }
            
            var warning_dialog = '<div class="modal fade" id="sessionTimeout-dialog">'
                                +'    <div class="modal-dialog modal-small">'
                                +'        <div class="modal-content">'
                                +'            <div class="modal-header">'
                                +'                <button id="_close" type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>'
                                +'                <h4 class="modal-title">'+ o.title +'</h4>'
                                +'            </div>'
                                +'            <div class="modal-body">'+ o.message +'</div>'
                                +'            <div class="modal-footer">'
                                +'                <button id="sessionTimeout-dialog-logout" type="button" class="btn btn-default">Logout</button>'
                                +'                <button id="sessionTimeout-dialog-keepalive" type="button" class="btn btn-primary" data-dismiss="modal">Stay Connected</button>'
                                +'            </div>'
                                +'        </div>'
                                +'    </div>'
                                +'</div>';
            
            $('body').append(warning_dialog);
            
            $('#sessionTimeout-dialog-logout').on('click', function () { window.location = o.logoutUrl; });
            
            $('#_close,#sessionTimeout-dialog-keepalive').click(function() {
                doKeepAlive();
            });
            // Begin warning period
            controlDialogTimer('start');
        },
        
        sessionTimeoutKeepAlive: function() {
            controlRedirTimer('restart');
            controlDialogTimer('restart');
        }
    };
}();

$(function() {
    Session.sessionTimeout({
        title: 'Session Timeout Notification',
        message: 'Your session is about to expire.',
        keepAliveUrl: contextPath + '/admin/session/keep-alive',
        redirUrl: contextPath + '/account/login',
        logoutUrl: contextPath + '/account/logout',
        warnAfter: 1500000,
        redirAfter: 1780000
    });
    
    $(document).ajaxComplete(function() {
        Session.sessionTimeoutKeepAlive();
    });
});

C物 2013-12-05 16:11 发表评论
]]>
忘掉jQueryQ用JavaScript原生APIhttp://www.aygfsteel.com/libin2722/articles/406911.htmlC物C物Thu, 28 Nov 2013 01:31:00 GMThttp://www.aygfsteel.com/libin2722/articles/406911.htmlhttp://www.aygfsteel.com/libin2722/comments/406911.htmlhttp://www.aygfsteel.com/libin2722/articles/406911.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/406911.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/406911.html阅读全文

C物 2013-11-28 09:31 发表评论
]]>
十个jQuery囄d插g推荐http://www.aygfsteel.com/libin2722/articles/341947.htmlC物C物Thu, 30 Dec 2010 00:44:00 GMThttp://www.aygfsteel.com/libin2722/articles/341947.htmlhttp://www.aygfsteel.com/libin2722/comments/341947.htmlhttp://www.aygfsteel.com/libin2722/articles/341947.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/341947.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/341947.html jQuery的画廊插件可以将分组囑փ和多媒体资料转成cMFlash的图像或照片。当qȝ片已l成为网站的重要l成部分QjQuery的重要性不能被忽视。下面ؓ你介l了10个最有美感,创新性和创造性的jQuery囄d插gQ?span class="Apple-converted-space"> 

1.How to Create a Simple Slideshow using Mootools / JQuery 
当我们想要在有限的屏q空间展C很多内容,q要使用到灯片。灯片是最佳的可以展现大量的信息的方式。在q篇文章中我展CZ用MooTools / Jquery做出单的qȝ片的q程?span class="Apple-converted-space"> 



2.jbgallery 2.0 
jbgalleryQ可实现大囄全页展示功能Q可自动播放Q控制播攑֛片等Q支持单囄、多囄、多囑ֺ、阴影、网站背景色以及对话模式{。jbgallery有两个基本菜单,一个类似音乐播放按钮和一个直接链接单囄播放按钮Q同时提供公共API接口去除播放控制lgQ以便扩展Q意自定义播放控制按钮Qjbgallery插g功能强大Q而且使用单?span class="Apple-converted-space"> 


3.Minimalistic Slideshow Gallery with jQuery 
是一个简单而漂亮,以灯片方式播放照片的相册控件。其做法是将所有羃略图攑֜一个导航网gQ用户可以利用这个网格查看,暂停/播放Q浏览照片。网g从播攑֮器上方弹出,让用h览整个相册的~略N?span class="Apple-converted-space"> 



4. Galleria 
Galleria是一个采用jQuery开发的囄展示插g。它通过~略囑֯航一张一张的昄大的囄。支持通过CSS讄整个相册的风根{能够按比例创徏~略囑ƈ剪切成适合在羃略图容器中显C的图片。能够触一些事Ӟ因此可以在图片加载时执行一些动作?span class="Apple-converted-space"> 



5. Galleriffic 
Galleriffic是一个用于创建快速展C相册中照片的jQuery插g。图片既可以以灯片的方式查看,也可以手动点ȝ略图查看。Gallerifficq支持分,从而得它能够展示更多的图片?span class="Apple-converted-space"> 



6. Pikachoos 
Pikachoose是一个基于jquery的轻量相册插g,它允许用戯定义qȝ?按钮,自动播放. 



7. Smooth Div Scroll 
q是一个图片或内容水^滚动的jquery插gQ滚动效果非常^滑、舒?span class="Apple-converted-space"> 



8.FancyBox 
ZjQuery开发的Lightbox插g。支持对攑֤的图片添加阴影效果,对于一l相关的囄dD操作按纽Q该Lightbox除了能够展示囄之外Q还可以展示iframed内容Q?通过CSS自定义外观?span class="Apple-converted-space"> 



9.Sliding Image Gallery jQuery Plug-in 
在SlidingGallery插g会的囑փl,变成他们的图像周期性画廊,用户可以通过点击q告。一个图像将被集中在屏幕上,有两个较的囑փ关闭的边~。用户可以单MQ一较小的图像,使之向中心或中心囑փ攑֤。ؓ获得最佳的使用Q这个插件应该适用?个或更多囄Q但可以用更的工作Q图片会被复Ӟ从而L辑ֈ7个)?span class="Apple-converted-space"> 



10.slideViewerPro 
slideViewerPro是一个完全可定制的jQuery Image Gallery插g。支持Q意多的图片,可以讄是否自动展示囄Q开x题,开x拽,自定义向?向后按纽Q自定义qȝ播放动画?span class="Apple-converted-space"> 



C物 2010-12-30 08:44 发表评论
]]>
30ƾajaxҎQ针对Lightbox和Modal Dialoghttp://www.aygfsteel.com/libin2722/articles/338535.htmlC物C物Sat, 20 Nov 2010 04:12:00 GMThttp://www.aygfsteel.com/libin2722/articles/338535.htmlhttp://www.aygfsteel.com/libin2722/comments/338535.htmlhttp://www.aygfsteel.com/libin2722/articles/338535.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/338535.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/338535.html阅读全文

C物 2010-11-20 12:12 发表评论
]]>
(转蝲)jQuery学习: 实现select multiple左右d和删除功?/title><link>http://www.aygfsteel.com/libin2722/articles/256729.html</link><dc:creator>C物</dc:creator><author>C物</author><pubDate>Thu, 26 Feb 2009 01:14:00 GMT</pubDate><guid>http://www.aygfsteel.com/libin2722/articles/256729.html</guid><wfw:comment>http://www.aygfsteel.com/libin2722/comments/256729.html</wfw:comment><comments>http://www.aygfsteel.com/libin2722/articles/256729.html#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://www.aygfsteel.com/libin2722/comments/commentRss/256729.html</wfw:commentRss><trackback:ping>http://www.aygfsteel.com/libin2722/services/trackbacks/256729.html</trackback:ping><description><![CDATA[本文来自Qhttp://www.aygfsteel.com/absolutedo/archive/2009/02/20/255790.html<br /> <br /> 目要实现这L一个功?如下图所C?:选择左边下拉列表框中的选项,点击d按钮,把选择的选项Ud到右边的下拉列表框中,同样的选择双的选项,? d除按?x选择的选项Ud到左边的下拉列表框中.怿用js很多朋友都写q?下面是我用jQuery来实现这L功能?具体代码如下:<br /> <br /> <img style="width: 1030px; height: 169px;" alt="" src="../../images/blogjava_net/absolutedo/select_multiple.jpg" border="0" width="1030" height="169" /><br /> <br /> 下拉列表<br /> <table width="95%" cellpadding="0" align="center" class="listshow" border="1" cellspacing="0"><br />  <tr><br />      <td colspan="4" align="center">选择分包</td><br />     </tr><br />  <tr><br />   <td class="black" width="30%" align="center" height="150"><br />               <select id="fb_list" multiple="multiple"  style="text-align:center;width:300px;height:150px;"><br />               <br />                </select>  <br />         </td><br />         <td align="center" width="5%"><br />          <input type="button" id="add" value="d>>" /><br />             <br/><br />             <br/><br />             <input type="button" id="delete" value="<<删除" /><br />         </td><br />         <td class="black" width="30%" align="center"><br />          <select id="select_list" multiple="multiple" style=" text-align:center;width:300px;height:150px;"><br />                       <br />             </select><br />         </td><br />  </tr> <br /> </table><br /> <br /> jQuery代码:<br /> /**<br />   *动态的l左边的下拉列表创徏选项<br />   *具体情况可以从数据库d数据动态创建选项<br />   */<br /> $(document).ready(function(){<br />         for(var i=1;i<=5;i++)<br />         {<br />                $("#fb_list").append("<option value='"+i+"'>公开招标型机采?0"+i+"</option>");  <br />         } <br /> })<br /> <p>$(function(){<br />      $("#add").click(function(){<br />               if($("#fb_list option:selected").length>0)<br />               {<br />                        $("#fb_list option:selected").each(function(){<br />                             $("#select_list").append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option");<br />                             $(this).remove();  <br />                        }) <br />               }<br />               else<br />               {<br />                        alert("请选择要添加的分包Q?);<br />               }<br />        })<br /> })</p> <p><br /> $(function(){ <br />              $("#delete").click(function(){<br />                       if($("#select_list option:selected").length>0)<br />                       {<br />                                $("#select_list option:selected").each(function(){<br />                                           $("#fb_list").append("<option value='"+$(this).val()+"'>"+$(this).text()+"</option");<br />                                            $(this).remove();  <br />                                }) <br />                       }<br />                       else<br />                       {<br />                                alert("请选择要删除的分包Q?);<br />                       } <br />            })<br /> })</p> <br /> <img src ="http://www.aygfsteel.com/libin2722/aggbug/256729.html" width = "1" height = "1" /><br><br><div align=right><a style="text-decoration:none;" href="http://www.aygfsteel.com/libin2722/" target="_blank">C物</a> 2009-02-26 09:14 <a href="http://www.aygfsteel.com/libin2722/articles/256729.html#Feedback" target="_blank" style="text-decoration:none;">发表评论</a></div>]]></description></item><item><title>jquery技巧ȝhttp://www.aygfsteel.com/libin2722/articles/252920.htmlC物C物Mon, 02 Feb 2009 02:44:00 GMThttp://www.aygfsteel.com/libin2722/articles/252920.htmlhttp://www.aygfsteel.com/libin2722/comments/252920.htmlhttp://www.aygfsteel.com/libin2722/articles/252920.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/252920.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/252920.html 一、简?br />
1.1、概q?br /> 随着WEB2.0及ajax思想在互联网上的快速发展传播,陆箋出现了一些优 U的Js框架Q其中比较著名的有Prototype、YUI、jQuery、mootools、Bindows以及国内的JSVM框架{,通过这些JS 框架应用到我们的目中能够ɽE序员从设计和书写繁杂的JS应用中解脱出来,关注点转向功能需求而非实现l节上,从而提高项目的开发速度?br /> jQuery 是prototype之后的又一个优U的Javascript框架。它是由 John Resig ?2006 q初创徏的,它有助于? JavaScript™ 以及Ajax ~程。有Z用这L一比喻来比较prototype和jQueryQprototype像JavaQ而jQuery像ruby. 它是一个简z快速灵zȝJavaScript框架Q它能让你在你的|页上简单的操作文档、处理事件、实现特效ƈ为Web面dAjax交互?br />
它具有如下一些特点:
1、代码简l、语义易懂、学习快速、文档丰富?br /> 2、jQuery是一个轻量的脚本,其代码非常小巧,最新版的JavaScript包只?0K左右?br /> 3、jQuery支持CSS1-CSS3,以及基本的xPath?br /> 4、jQuery是跨览器的Q它支持的浏览器包括IE 6.0+, FF 1.5+, Safari 2.0+, Opera 9.0+?br /> 5、可以很Ҏ的ؓjQuery扩展其他功能?br /> 6、能JS代码和HTML代码完全分离Q便于代码和l护和修攏V?br /> 7、插件丰富,除了jQuery本n带有的一些特效外Q可以通过插g实现更多功能Q如表单验证、tabD、拖放效果、表格排序、DataGridQ树形菜单、图像特效以及ajax上传{?br />
jQuery的设计会改变你写JavaScript代码的方式,降低你学习用JS操作|页的复杂度Q提高网JS开发效率,无论对于js初学者还是资׃ӞjQuery都将是您的首选?br /> jQuery适合于设计师、开发者以及那些还好者,同样适合用于商业开发,可以说jQuery适合MJavaScript应用的地方,可用于不同的Web应用E序中?br /> 官方站点Q?a target="_blank">http://jquery.com/  中文站点Q?a target="_blank">http://jquery.org.cn/

1.2、目?br /> 通过学习本文档,能够对jQuery有一个简单的认识了解Q清楚JQuery与其他JS框架的不同,掌握jQuery的常用语法、用技巧及注意事项?br />
二、用方?br /> 在需要用JQuery的页面中引入JQuery的js文g卛_?br /> 例如Q?lt;script type="text/javascript" src="js/jquery.js"></script>
引入之后便可在页面的L地方使用jQuery提供的语法?br />
三、学习教E及参考资?br /> 请参照《jQuery中文API手册》和http://jquery.org.cn/visual/cn/index.xml
推荐两篇不错的jquery教程Q《jQuery的vҎE》和《?jQuery ?Ajax 开发?br /> (说明Q以上文档都攑֜了【附件】中)

四、语法ȝ和注意事?br />
1、关于页面元素的引用
通过jquery?()引用元素包括通过id、class、元素名以及元素的层U关pddom或者xpath条g{方法,且返回的对象为jquery对象Q集合对象)Q不能直接调用dom定义的方法?br />
2、jQuery对象与dom对象的{?br /> 只有jquery对象才能使用jquery定义的方法。注意dom对象和jquery对象是有区别的,调用Ҏ时要注意操作的是dom对象q是jquery对象?br /> 普通的dom对象一般可以通过$()转换成jquery对象?br /> 如:$(document.getElementById("msg"))则ؓjquery对象Q可以用jquery的方法?br /> ׃jquery对象本n是一个集合。所以如果jquery对象要{换ؓdom对象则必d出其中的某一,一般可通过索引取出?br /> 如:$("#msg")[0]Q?("div").eq(1)[0]Q?("div").get()[1]Q?("td")[5]q些都是dom对象Q可以用dom中的ҎQ但不能再用Jquery的方法?br /> 以下几种写法都是正确的:
$("#msg").html();
$("#msg")[0].innerHTML;
$("#msg").eq(0)[0].innerHTML;
$("#msg").get(0).innerHTML;

3、如何获取jQuery集合的某一?br /> ? 于获取的元素集合Q获取其中的某一(通过索引指定Q可以用eq或get(n)Ҏ或者烦引号获取Q要注意Qeqq回的是jquery对象Q而get (n)和烦引返回的是dom元素对象。对于jquery对象只能使用jquery的方法,而dom对象只能使用dom的方法,如要获取W三?lt; div>元素的内宏V有如下两种ҎQ?br /> $("div").eq(2).html();              //调用jquery对象的方?br /> $("div").get(2).innerHTML;       //调用dom的方法属?br />
4、同一函数实现set和get
Jquery中的很多Ҏ都是如此Q主要包括如下几个:
$("#msg").html();              //q回id为msg的元素节点的html内容?br /> $("#msg").html("<b>new content</b>");      
//?#8220;<b>new content</b>” 作ؓhtml串写入id为msg的元素节点内容中,面昄_体的new content

$("#msg").text();              //q回id为msg的元素节点的文本内容?br /> $("#msg").text("<b>new content</b>");      
//?#8220;<b>new content</b>” 作ؓ普通文本串写入id为msg的元素节点内容中,面昄_体?lt;b>new content</b>

$("#msg").height();              //q回id为msg的元素的高度
$("#msg").height("300");       //id为msg的元素的高度设ؓ300
$("#msg").width();              //q回id为msg的元素的宽度
$("#msg").width("300");       //id为msg的元素的宽度设ؓ300

$("input").val(");       //q回表单输入框的value?br /> $("input").val("test");       //表单输入框的valueD为test

$("#msg").click();       //触发id为msg的元素的单击事g
$("#msg").click(fn);       //为id为msg的元素单M件添加函?br /> 同样blur,focus,select,submit事g都可以有着两种调用Ҏ

5、集合处理功?br /> 对于jqueryq回的集合内Ҏ需我们自己循环遍历q对每个对象分别做处理,jquery已经为我们提供的很方便的Ҏq行集合的处理?br /> 包括两种形式Q?br /> $("p").each(function(i){this.style.color=['#f00','#0f0','#00f']})      
//为烦引分别ؓ0Q?Q?的p元素分别讑֮不同的字体颜艌Ӏ?br />
$("tr").each(function(i){this.style.backgroundColor=['#ccc','#fff'][i%2]})      
//实现表格的隔行换色效?br />
$("p").click(function(){.html())})              
//为每个p元素增加了click事gQ单L个p元素则弹出其内容

6、扩展我们需要的功能
$.extend({
       min: function(a, b){return a < b?a:b; },
       max: function(a, b){return a > b?a:b; }
});       //为jquery扩展了min,max两个Ҏ
使用扩展的方法(通过“$.Ҏ?#8221;调用Q:
+",min="+$.min(10,20));

7、支持方法的q写
所谓连写,卛_以对一个jquery对象q箋调用各种不同的方法?br /> 例如Q?br /> $("p").click(function(){.html())})
.mouseover(function(){})
.each(function(i){this.style.color=['#f00','#0f0','#00f']});

8、操作元素的样式
主要包括以下几种方式Q?br /> $("#msg").css("background");              //q回元素的背景颜?br /> $("#msg").css("background","#ccc")       //讑֮元素背景为灰?br /> $("#msg").height(300); $("#msg").width("200");       //讑֮宽高
$("#msg").css({ color: "red", background: "blue" });//以名值对的Ş式设定样?br /> $("#msg").addClass("select");       //为元素增加名UCؓselect的class
$("#msg").removeClass("select");       //删除元素名称为select的class
$("#msg").toggleClass("select");       //如果存在Q不存在Q就删除Q添加)名称为select的class

9、完善的事g处理功能
Jquery已经为我们提供了各种事g处理ҎQ我们无需在html元素上直接写事gQ而可以直接ؓ通过jquery获取的对象添加事件?br /> 如:
$("#msg").click(function(){})       //为元素添加了单击事g
$("p").click(function(i){this.style.color=['#f00','#0f0','#00f']})
//Z个不同的p元素单击事g分别讑֮不同的处?br /> jQuery中几个自定义的事Ӟ
Q?Qhover(fn1,fn2)Q一个模仿悬停事Ӟ鼠标UdC个对象上面及Udq个对象Q的Ҏ。当鼠标UdC个匹配的元素上面Ӟ会触发指定的W一个函数。当鼠标Udq个元素Ӟ会触发指定的W二个函数?br /> //当鼠标放在表格的某行上时class|ؓoverQ离开时置为out?br /> $("tr").hover(function(){
$(this).addClass("over");
},
       function(){
       $(this).addClass("out");
});
Q?Qready(fn):当DOM载入qA可以查询及操U|l定一个要执行的函数?br /> $(document).ready(function(){})
//面加蝲完毕提示“Load Success”,相当于onload事g。与$(fn){h
Q?Qtoggle(evenFn,oddFn): 每次点击时切换要调用的函数。如果点M一个匹配的元素Q则触发指定的第一个函敎ͼ当再ơ点d一元素Ӟ则触发指定的W二个函数。随后的每次点击都重复对q两个函数的轮番调用?br />        //每次点击时轮换添加和删除名ؓselected的class?br />        $("p").toggle(function(){
              $(this).addClass("selected");   
       },function(){
              $(this).removeClass("selected");
       });
Q?Qtrigger(eventtype): 在每一个匹配的元素上触发某cM件?br /> 例如Q?br />        $("p").trigger("click");              //触发所有p元素的click事g
Q?Qbind(eventtype,fn)Qunbind(eventtype): 事g的绑定与反绑?br /> 从每一个匹配的元素中(dQ删除绑定的事g?br /> 例如Q?br /> $("p").bind("click", function(){.text());});       //为每个p元素d单击事g
$("p").unbind();       //删除所有p元素上的所有事?br /> $("p").unbind("click")       //删除所有p元素上的单击事g

10、几个实用特效功?br /> 其中toggle()和slidetoggle()Ҏ提供了状态切换功能?br /> 如toggle()Ҏ包括了hide()和show()Ҏ?br /> slideToggle()Ҏ包括了slideDown()和slideUpҎ?br />
11、几个有用的jQueryҎ
$.browser.览器类型:浏览器cd。有效参敎ͼsafari, opera, msie, mozilla。如是否ieQ?.browser.isieQ是ie览器则q回true?br /> $.each(obj, fn)Q通用的P代函数。可用于q似地P代对象和数组Q代替@环)?br /> ?br /> $.each( [0,1,2], function(i, n){ ; });
{h于:
var tempArr=[0,1,2];
for(var i=0;i<tempArr.length;i++){
       ;
}
也可以处理json数据Q如
$.each( { name: "John", lang: "JS" }, function(i, n){ ; });
l果为:
Name:name, Value:John
Name:lang, Value:JS
$.extend(target,prop1,propN)Q用一个或多个其他对象来扩展一个对象,q回q个被扩展的对象。这是jquery实现的承方式?br /> 如:
$.extend(settings, options);      
//合ƈsettings和optionsQƈ合q结果返回settings中,相当于optionsl承settingq将l承l果保存在setting中?br /> var settings = $.extend({}, defaults, options);
//合ƈdefaults和optionsQƈ合q结果返回到setting中而不覆盖default内容?br /> 可以有多个参敎ͼ合ƈ多项q返回)
$.map(array, fn)Q数l映。把一个数l中的项?处理转换?保存到到另一个新数组中,q返回生成的新数l?br /> 如:
var tempArr=$.map( [0,1,2], function(i){ return i + 4; });
tempArr内容为:[4,5,6]
var tempArr=$.map( [0,1,2], function(i){ return i > 0 ? i + 1 : null; });
tempArr内容为:[2,3]
$.merge(arr1,arr2):合ƈ两个数组q删除其中重复的目?br /> 如:$.merge( [0,1,2], [2,3,4] )       //q回[0,1,2,3,4]
$.trim(str)Q删除字W串两端的空白字W?br /> 如:$.trim("  hello, how are you?   ");        //q回"hello,how are you? "

12、解册定义Ҏ或其他类库与jQuery的冲H?br /> 很多时候我们自己定义了$(id)Ҏ来获取一个元素,或者其他的一些jscd如prototype也都定义?ҎQ如果同时把q些内容攑֜一起就会引起变量方法定义冲H,JqueryҎ专门提供了方法用于解x问题?br /> ? 用jquery中的jQuery.noConflict();Ҏ卛_把变?的控制权让渡l第一个实现它的那个库或之前自定义?Ҏ。之后应? Jquery的时候只要将所有的$换成jQuery卛_Q如原来引用对象Ҏ$("#msg")改ؓjQuery("#msg")?br /> 如:
jQuery.noConflict();
// 开始用jQuery
jQuery("div   p").hide();
// 使用其他库的 $()
$("content").style.display = 'none';

C物 2009-02-02 10:44 发表评论
]]>
jquery中文指导:15天学会jqueryhttp://www.aygfsteel.com/libin2722/articles/200689.htmlC物C物Thu, 15 May 2008 09:38:00 GMThttp://www.aygfsteel.com/libin2722/articles/200689.htmlhttp://www.aygfsteel.com/libin2722/comments/200689.htmlhttp://www.aygfsteel.com/libin2722/articles/200689.html#Feedback0http://www.aygfsteel.com/libin2722/comments/commentRss/200689.htmlhttp://www.aygfsteel.com/libin2722/services/trackbacks/200689.html阅读全文

C物 2008-05-15 17:38 发表评论
]]>
վ֩ģ壺 ǡ| | | Į| | | | ָ| | | | ͼʲ| | | | ϻ| Ʊ| | ɽ| | ϰˮ| ¡| | | | | ӳ| ÷| | | | ʯ̨| | | | | | | բ| Ϫ| ɽ|