in

vbCity Blogs

New (temp) place for vbCity Blogs

Andy Bonner's Blog

My SharePoint titbits and other things that take my fancy.

October 2008 - Posts

  • How to get wz_tooltip.js working in SharePoint

    Came across an excellent javascript tooltip library by Walter Zorn that I thought would be a great additional to my SharePoint sites.  Unfortunately follow the instructions on his site would work fine in a normal Asp.Net app but not within the SharePoint environment.

    However I did eventually get it working when my grey matter kicked into gear and thought I better blog it quick before senility kicked in and I forgot it Wink

    Edit your master page and add a SharePoint:ScriptLink to the location of the wz_tooltip.js file i.e

    underneath

    <SharePoint:ScriptLink name="init.js" runat="server"/>
    

     add a new line with

    <SharePoint:ScriptLink name="Skullcrusher/wz_tooltip.js" runat="server"/>
    

     obviously just change it to match your location.

    This unfortunately isn't sufficient to get it working due to SharePoints quircks and I was getting "tt_aElt.0.style is null o not an object" errors.  This turned out to be due to the fact that the tooltip wasn't getting initialized properly and there is a simple fix.

    All you need to do is add a call to tt_Init in the onload of the body i.e. change

    <body class="body" onload="BLOCKED SCRIPT_spBodyOnLoadWrapper();">
    

    to

    <body class="body" onload="BLOCKED SCRIPT_spBodyOnLoadWrapper();tt_Init();">
    

    And that's it you can now use it in any SharePoint page. 

Copyright 1998-2009 vbCity.com LLC
Powered by Community Server (Non-Commercial Edition), by Telligent Systems