You should be able to copy it inside the <script> tag anywhere on the page where you have jQuery, and it should work.
$( document ).ready( function(){ setMaxWidth(); $( window ).bind( "resize", setMaxWidth ); //Remove this if it not needed. It will react when window changes size. function setMaxWidth() { $( "#mainContainer" ).css( "maxWidth", ( $( window ).width() * 0.7 | 0 ) + "px" ); } });
Esailija
source share