I have a jQuery plugin Backstretch installed and working with my Refinery Rails App.
The plugin loads the 1 image I have listed in
application.js
//= require 'jquery-backstretch'
$.backstretch("/system/images/W1siZiIsIjIwMTMvMDMvMjcvMjJfNTZfMjRfOTkyX3NsYXRlX2JnLnBuZyJdXQ/slate-bg.png");
I am trying to work from an example I found that stated to "Use if/else statements to load backstretch. i.e. if($("body#about"))....else if($("body#contact")...";
however I don't really know how to write this properly. Here's what I tried:
application.js
//= require 'jquery-backstretch'
if ($"body#home"($.backstretch("/system/images/W1siZiIsIjIwMTMvMDMvMjcvMjJfNTZfMjRfOTkyX3NsYXRlX2JnLnBuZyJdXQ/slate-bg.png"));
else if ($"body#our-passion".backstretch("/system/images/W1siZiIsIjIwMTMvMDMvMjUvMDBfMTlfMjlfMzgyX2JnXzFfYmlnLnBuZyJdXQ/bg-1-big.png"));
What is the proper way to write this? Or is there a better way to do this effect?