Forum Replies Created

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter beauhall

    (@beauhall)

    I figured out how to make it all work in jQuery. That works for me for now I suppose:

    Example:
    http://showcaseweather.com/?s=toyota

    Thread Starter beauhall

    (@beauhall)

    Here’s the solution in jQuery, except for that last part that I wished would push the padding height down. It’s not working.

    (function($) {
    	$(document).ready(function(){
    		var startX = 0;
    
    		var col1=0;
    		var col2=0;
    		var col3=0;
    		var defWidth, defHeight;
    		var tempX, tempY;
    
    	   	$('div.boxgrid-archive2012').each(function(){
    	   		defWidth = $(this).width();
    	    	defHeight = $(this).height();
    
    			// okay so, WHICH column is the smallest number?
    			tempX = 0;
    			if(col1<=col2 && col1<=col3){
    				tempX=0;
    				tempY=col1;
    				col1+=defHeight+35;
    			} else if (col2<=col1 && col2<=col3){
    				tempX=1;
    				tempY=col2
    				col2+=defHeight+35;
    			} else {
    				tempX=2;
    				tempY=col3;
    				col3+=defHeight+35;
    			}
    
    			destX = (tempX*(defWidth+35))+startX;
    			$(this).css({
    				top: tempY,
    				left: destX
    		       });
    
    		 });
    		$('div.padder').each(function(){
    			$(this).css('height', defHeight);
    		})
    	});
    }(jQuery));
Viewing 2 replies - 1 through 2 (of 2 total)