Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function productHeights(inRow, selector, param_arr) {
- var elems = selector.find(".product_wrapper");
- for (var i = 0; i < elems.length; i += inRow) {
- var divs = elems.slice(i, i + inRow);
- param_arr.forEach(function (elem) {
- divs.find(elem).attr('style', '');
- var temp_array = [];
- for (var j = 0; j < inRow + 1; j++) {
- temp_array.push(divs.eq(j).find(elem).outerHeight())
- }
- var maxHeight = Math.max.apply(Math, temp_array);
- divs.find(elem).height(parseInt(maxHeight));
- });
- }
- }
- app_shop.fn.resizeWrappers = function(obj){
- var nr = (app_shop.vars.view === 1 ? 1: 3);
- obj.each(function(){
- productHeights(nr , $(this), ['.search_product_producer', '.product-name', '.product-firm', 'div.product_prices']);
- });
- }
- app_shop.run(function(){
- console.log('resizeWrappers - start');
- app_shop.fn.resizeWrappers($('#search'));
- console.log('resizeWrappers - end');
- }, [1,2,3,4]);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement