<?php if (!defined('SITE')) exit('No direct script access allowed');
/**
* jquery backgrounder plugin
*
* @version 0.1
* @author orionrush
*
* @use <plug:jsBackstreach img='<%bgimg%>', speed='150' />
* 1. in the <head> of your template: ndxz-studio/site/your-template/index.php
* 2. to prevent the image from being loaded twice in both the default backgrounder plugin and in this plugin
* - remove <%bgimg%> from the <plug:backgrounder />
*/
function jsBackstreach($img='', $speed='')
{
//nothing there!
if ($img == '') return;
//default speed is overwriten in plugin tag
if ($speed == '') $speed = 150;
$script = "<script type='text/javascript' src='". BASEURL . BASENAME . "/site/js/jquery.backstretch.min.js'></script>"."\n";
$bg = "<script type='text/javascript'>"."\n"."$.backstretch('". BASEURL ."/files/$img', {speed: $speed});"."\n"."</script>"."\n";
return $script.$bg;
}
?>