backstretch for indexhibit


/ Published in: PHP
Save to your folder(s)

This is a jquery full screen background image plugin for indexhibit using
http://srobbin.com/jquery-plugins/jquery-backstretch/


Copy this code and paste it in your HTML
  1. <?php if (!defined('SITE')) exit('No direct script access allowed');
  2. /**
  3.  * jquery backgrounder plugin
  4.  *
  5.  * @version 0.1
  6.  * @author orionrush
  7.  *
  8.  * @use <plug:jsBackstreach img='<%bgimg%>', speed='150' />
  9.  * 1. in the <head> of your template: ndxz-studio/site/your-template/index.php
  10.  * 2. to prevent the image from being loaded twice in both the default backgrounder plugin and in this plugin
  11.  * - remove <%bgimg%> from the <plug:backgrounder />
  12.  */
  13.  
  14. function jsBackstreach($img='', $speed='')
  15. {
  16. //nothing there!
  17. if ($img == '') return;
  18. //default speed is overwriten in plugin tag
  19. if ($speed == '') $speed = 150;
  20.  
  21. $script = "<script type='text/javascript' src='". BASEURL . BASENAME . "/site/js/jquery.backstretch.min.js'></script>"."\n";
  22. $bg = "<script type='text/javascript'>"."\n"."$.backstretch('". BASEURL ."/files/$img', {speed: $speed});"."\n"."</script>"."\n";
  23.  
  24. return $script.$bg;
  25. }
  26. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.