文章出處

   if (typeof jQuery == 'undefined') {

    alert("請先導入jQuery");
} else {
    jQuery.extend({
        quan_fan: quan_fan

    });
}
function quan_fan(all, other) {
    /// <summary>
    ///         全選,反選
    /// </summary>
    /// <param name="all">全選(按鈕(checkbox))JQuery對象</param>
    /// <param name="other">其它(按鈕(checkbox))JQuery對象</param>
    all.click(function () {
        if (all[0].checked == true) {
            other.each(function () {
                this.checked = true;
            });
        }
        else {
            other.each(function () {
                this.checked = false;
            });
        }
    });
    other.each(function () {
        $(this).click(function () {
            if (this.checked == false) {
                all[0].checked = false;
            }
        });
    });
}
  使用
  

 


文章列表




Avast logo

Avast 防毒軟體已檢查此封電子郵件的病毒。
www.avast.com


arrow
arrow
    全站熱搜
    創作者介紹
    創作者 大師兄 的頭像
    大師兄

    IT工程師數位筆記本

    大師兄 發表在 痞客邦 留言(0) 人氣()