¿ìËÙÒµÎñͨµÀ

javascriptÉè¼Æģʽ:·½·¨µÄÁ´Ê½µ÷ÓÃ

×÷Õß ØýÃû¼¼Êõ À´Ô´ ÍøÒ³ÖÆ×÷ ä¯ÀÀ ·¢²¼Ê±¼ä 2012-03-06

ÔÚjavascriptÖУ¬·½·¨µÄÁ´Ê½µ÷ÓúÜÁ÷ÐУ¬Ê¹ÓÃjQueryµÄÅóÓѶԴËÒ»¶¨ÉîÓÐÌå»á¡£ÔÚ¡¶javascriptÉè¼Æģʽ¡·ÖжÔÕâÖÖ·½·¨×÷Á˱ȽÏÏêϸµÄÃèÊö£¬ÊµÏÖ·½·¨µÄÁ´Ê½µ÷Óã¬Ö»ÐëÈÃÔÚÔ­ÐÍÖж¨ÒåµÄ·½·¨¶¼·µ»Øµ÷ÓÃÕâЩ·½·¨µÄʵÀý¶ÔÏóµÄÒýÓü´¿É£¬¿´¿´ÊéÖеÄÕâ¶Î´úÂ룺

(function() {
  function _$(els) {
    this.elements = [];
    for (var i = 0, len = els.length; i < len; ++i) {
      var element = els[i];
      if (typeof element == ''string'') {
        element = document.getElementById(element);
      }
      this.elements.push(element);
}
  };
  _$.prototype = {
    each: function(fn) {
      for ( var i = 0, len = this.elements.length; i < len; ++i ) {
        fn.call(this, this.elements[i]);
      }
      return this;
    },
    setStyle: function(prop, val) {
      this.each(function(el) {
        el.style[prop] = val;
      });
      return this;
    },
    show: function() {
      var that = this;
      this.each(function(el) {
        that.setStyle(''display'', ''block'');
      });
      return this;
    },
    addEvent: function(type, fn) {
      var add = function(el) {
        if (window.addEventListener) {
          el.addEventListener(type, fn, false);
        }
        else if (window.attachEvent) {
  &n

ÁèÖڿƼ¼×¨ÒµÌṩ·þÎñÆ÷×âÓᢷþÎñÆ÷Íйܡ¢ÆóÒµÓʾ֡¢ÐéÄâÖ÷»úµÈ·þÎñ£¬¹«Ë¾ÍøÕ¾£ºhttp://www.lingzhong.cn ΪÁ˸ø¹ã´ó¿Í»§Á˽â¸ü¶àµÄ¼¼ÊõÐÅÏ¢£¬±¾¼¼ÊõÎÄÕÂÊÕ¼¯À´Ô´ÓÚÍøÂç,ÁèÖڿƼ¼×ðÖØÎÄÕÂ×÷ÕߵİæȨ£¬Èç¹ûÓÐÉæ¼°ÄãµÄ°æȨÓбØҪɾ³ýÄãµÄÎÄÕ£¬ÇëºÍÎÒÃÇÁªÏµ¡£ÒÔÉÏÐÅÏ¢ÓëÎÄÕÂÕýÎÄÊDz»¿É·Ö¸îµÄÒ»²¿·Ö,Èç¹ûÄúҪתÔر¾ÎÄÕÂ,Çë±£ÁôÒÔÉÏÐÅÏ¢£¬Ð»Ð»!

Copyright ©1999-2011 ÏÃÃÅÁèÖڿƼ¼ÓÐÏÞ¹«Ë¾ ÏÃÃÅÓÅͨ»¥Áª¿Æ¼¼¿ª·¢ÓÐÏÞ¹«Ë¾ All rights reserved

µØÖ·(ADD)£ºÏÃÃÅÈí¼þÔ°¶þÆÚÍûº£Â·63ºÅ701E£¨¶«ÄÏÈÚͨÅÔ£© Óʱà(ZIP)£º361008

µç»°£º0592-5908028 ´«Õ棺0592-5908039 ×ÉѯÐÅÏ䣺web@lingzhong.cn ×ÉѯOICQ£º173723134

¡¶ÖлªÈËÃñ¹²ºÍ¹úÔöÖµµçÐÅÒµÎñ¾­ÓªÐí¿ÉÖ¤¡·ÃöB2-20100024  ICP±¸°¸:ÃöICP±¸05037997ºÅ