1. 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

Discussion in 'Styling and Customization Questions' started by Frode789, Feb 2, 2014.

  1. Frode789

    Frode789 Active Member

    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: Feb 2, 2014
  2. Jake Bunce

    Jake Bunce XenForo Moderator Staff Member

    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>
    
     
    Allan likes this.
  3. Frode789

    Frode789 Active Member

    It worked, thanks!
     

Share This Page