Best way to replace <body>?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • SNOWCRAZE
    New Member
    • Oct 2002
    • 23
    • 3.0.7

    Best way to replace <body>?

    I want to replace all <body> to:

    <body onload="mm_preloadimages('images/m_homeh.gif','images/
    m_msgh.gif','images/m_galleryh.gif','images/m_wallh.gif','images/
    m_membersh.gif','images/m_linksh.gif','images/m_abth.gif')">

    I know there is no way to put stuff on CSS (would be nice) and can't use preg_replace or str_replace since <body> is html code, not variable...

    Means I have to use "Search in Templates" > "Find and replace in Templates" But before I do it, do you have any other better solution for this? seem i can't put "onload" on somehwere else but <body>...
  • Wayne Luke
    vBulletin Technical Support Lead
    • Aug 2000
    • 74167

    #2
    You don't want to replace the body tag or the onload function call of vBulletin.

    You will want to add your new Javascript into the vBulletin_init() function within vbulletin_global.js.
    Translations provided by Google.

    Wayne Luke
    The Rabid Badger - a vBulletin Cloud demonstration site.
    vBulletin 5 API

    Comment

    • SNOWCRAZE
      New Member
      • Oct 2002
      • 23
      • 3.0.7

      #3
      Really? so I dont have to worry abt preload images for rollover, Ok I will test on it and see if it's work well, thanks!

      Comment

      • SNOWCRAZE
        New Member
        • Oct 2002
        • 23
        • 3.0.7

        #4
        Ohh gotcha. Why didn't I think of this long time ago! Thanks again.

        Comment

        • dlg
          New Member
          • Oct 2002
          • 23

          #5
          wow!

          Thanks for the tip, you save the day

          I just add the function at the bottom of the vbulletin_globals.js file and then on the footer template, right below the:

          vBulletin_init(); line

          I add my function

          that way it was included on my onload variable.

          Fast and easy, thanks again.

          Comment

          widgetinstance 262 (Related Topics) skipped due to lack of content & hide_module_if_empty option.
          Working...