jQuery - if statment, combined widths minus 100 must be less than body
<p>The following code checks the combined width of a set of divs, and if there less wide than the document body it changes the ID of a different div: </p>

<pre><code>$(document).ready(function() {
$('#makeMeScrollable').each(function() {
var totalImageWidth = 0;

$(".image-div", this).each(function () {
  totalImageWidth += $(this).width();
});

if (totalImageWidth &lt; $(document.body).width() ) {
   $(this).attr('id', 'makeMeScrollable2');
}

});
});
</code></pre>

<p>How can I change it so the combined width minus 1000px needs to be narrower than the body for the same thing to happen? Ive tried the following:</p>

<pre><code>if (totalImageWidth - 1000 &lt; $(document.body).width() ) {
</code></pre>

<p>Thanks </p>
