开发者

conflict between jquery 1.4.2 and jQuery 1.2.3

开发者_开发百科

I am using the two above described libraries, one for a type writer effect on some <ul> and the other is used with a script to match floating <div>s height.

When I link the jQuery 1.2.3, the typewriter stops and shows all the <ul> contents? what do you think I can do?

reference:

  • Matching height: http://filamentgroup.com/lab/setting_equal_heights_with_jquery
  • Text effect: http://web-development.tuljo.com/news-ticker-bbc-style


You should only be using a single version of the jQuery library, not multiple ones.

If you need to choose, go with the newer one (in your case 1.4.2).


you shouldn't try to mix two versions of the same library. that's just asking for things to break. Use the newer library and bring any requisite code up to date.


For an up-to-date version of equalHeights, see the following:

(function($) {
  $.fn.equalHeights = function(children) {
    return this.each(function() {

      var $this = $(this);
      var $children = $this.children();
      var highest = 0;

      $children.each(function(){
        var h = $(this).height();
        if (h > highest) {
          highest = h;
        }
      }).height(highest);
    });
  };
})(jQuery);

// example usage: $('#equalize').equalHeights();

This is an updated and adapted version of jQuery.equalheights.js plugin.


Thank you all guys for trying to help. I solved the problem by replacing the equal height plug-in to mootools: http://davidwalsh.name/mootools-equal-heights

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜