• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 Adding backstretch to Xenforo

Frode789

Active member
#1
I've added backstetch to WP, and it works great. So I wanted to do the same in Xenforo.

I've included in PAGE_CONTAINER before </head> this line:
Code:
<xen:require js="/js/jquery/backstretch.js" />
In WP I add the php command in header_functions.php. Where do you do this in Xenforo?
Code:
$.backstretch("/styles/default/xenforo/body-bg.jpg");
 
Last edited:

Jake Bunce

XenForo moderator
Staff member
#2
Use a $(document).ready:

Code:
<xen:require js="/js/jquery/backstretch.js" />
<script type="text/javascript">
$(document).ready(function(){
  $.backstretch("/styles/default/xenforo/body-bg.jpg");
});
</script>