js stretch background image

777 Views Asked by At

This code is using backstretch plugin (http://srobbin.com/jquery-plugins/jquery-backstretch/)

This should stretch background.jpg which is called by

    if($( ".container" ).length > 0) {
        $.backstretch("/images/background.jpg");

Is above the same as this then?

    $( "body" ).append( "<div class='bg' id='backstretch'>
                           <img src='/images/background.jpg' />
                         </div>" );
1

There are 1 best solutions below

0
On

no, $.backstretch() calls the plugin, which does more as just appending the image with markup. see https://github.com/srobbin/jquery-backstretch/blob/master/jquery.backstretch.js