« January 2010 | Main | March 2010 »

February 18, 2010

JS to make one button the same size as another

var padme = $('m_butt').offsetWidth - $('sum_butt').offsetWidth;

// The 3 is the padding applied to the first element, 
// which needs to be added to the difference

$('sum_butt').style.paddingRight = (padme + 3) + 'px';

Posted by pj at 09:45 AM | Comments (0)