/ Published in: PHP
This is a jquery full screen background image plugin for indexhibit using
http://srobbin.com/jquery-plugins/jquery-backstretch/
http://srobbin.com/jquery-plugins/jquery-backstretch/
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * 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; } ?>