I'm using backstretch with Cargo and it's mostly awesome. I've been able to use a different image on each page by having one referenced in the html (for the homepage) and one referenced in each page individually, however if I directly access a page (not via the nav bar) the backstretch image from the homepage appears (the one referenced in the html). Is there a way to fix this?
Here are my codes:
HTML:
<script type="text/javascript">
*
* jQuery Backstretch
* Version 1.1
* http://srobbin.com/jquery-plugins/jquery-backstretch/
*
* Add a dynamically-resized background image to the page
*
* Copyright (c) 2010 Scott Robbin (srobbin.com)
* Dual licensed under the MIT and GPL licenses.
*/
(function(a){a.backstretch=function(k,h,l){function m(c){d=e.width();b=d/i;if(b>=e.height()){f=(b-e.height())/2;g.centeredY&&a.extend(j,{top:"-"+f+"px"})}else{b=e.height();d=b*i;f=(d-e.width())/2;g.centeredX&&a.extend(j,{left:"-"+f+"px"})}a("#backstretch img").width(d).height(b).css(j);typeof c=="function"&&c()}var g={centeredX:true,centeredY:true,speed:0},e="onorientationchange"in window?a(document):a(window),i,d,b,f,j={left:0,top:0};h&&typeof h=="object"&&a.extend(g,h);a(document).ready(function(){if(k){var c=a("
").attr("id","backstretch").css({left:0,top:0,position:"fixed",overflow:"hidden",zIndex:-9999}),p=a("
![]()
").css({position:"relative",display:"none"}).bind("load",function(n){var o=a(this);i=a(n.target).width()/a(n.target).height();m(function(){o.fadeIn(g.speed,function(){typeof l=="function"&&l()})})}).appendTo(c);a("body").prepend(c);p.attr("src",k);a(window).resize(m)}});return this}})(jQuery);
</script>
<script type="text/javascript">
$(document).ready(function(){
jQuery.ajaxSetup( {
complete: handleAjaxComplete
});
/* Your image */
$.backstretch("https://files.me.com/joshuahenry/dtrmat");
});
function handleAjaxComplete(XMLHttpRequest, textStatus) {
$("#backstretch img").hide();
}
</script>
IN EACH PAGE:
<script type="text/javascript">$.backstretch("https://files.me.com/joshuahenry/gzi73z");</script>