0

I am trying to equal the view template div in backbone view.

 render: function(options){
        var highestBox = 0;
        this.collection.each(function(_itemData){
            var item = new ItemView({model : _itemData});
            this.$el.append(item.el);
            if (item.$el.height() > highestBox){
                highestBox = item.$el.height();
            }
        },this);
        $('#container .item').height(highestBox + 90);
 }

It works well in firefox yet in chrome, it returns height = 52px when I do console.log(highestBox) in this.collection loop.

I supposed the height of the view will be set to be the highest one, but it didn't. Any idea what could be causing this. Thanks.

Nothing
  • 2,644
  • 11
  • 64
  • 115
  • Causing what exactly? – c-smile Aug 25 '14 at 03:12
  • @c-smile : I supposed the height of the view will be set to be the highest one, but it didn't. – Nothing Aug 25 '14 at 03:24
  • 2
    Looks fine. Can you create a fiddle demonstrating the issue ? – coding_idiot Aug 25 '14 at 05:03
  • @coding_idiot : Here's my previous question http://stackoverflow.com/questions/25460121/equal-height-of-dynamic-column-in-backbone-js/25460577?noredirect=1#comment39730824_25460577, and setting height is in `itemListView` block of the question . Sorry for not creating a fiddle because it is too complicated to do it and I don't know how. Hope you don't mind.. thanks before hand. – Nothing Aug 27 '14 at 02:11

0 Answers0