ToolTip package (Walter Zorn's) performance issue

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • fochie

    #1

    ToolTip package (Walter Zorn's) performance issue

    Greetings,

    First time append.

    I have a dynamic page that can potentially contain thousands of links.
    Each link has an onmouseover specified with Walter Zorn's Tool Tip
    feature to pop up a small image. This has been working fine but I
    noticed that a page with many links loads very slowly. I then realized
    that the images that are used for the onmouseover pop ups are all
    automatically being downloaded when the page initially loads.

    I wouldn't expect these images to be referenced by the browser until an
    onmouseover event occurs, but that does not seem to be the case.

    I thought I could get around this by changing the Tool Tips to call a
    JS function (that would eventually invoke a server side PHP to serve up
    the image), instead of specifying an <img> tag in the Tool Tip, but the
    JS function also gets called immediately when the page loads as well
    (for each Tool Tip specified on the page).

    I boiled a test page down to a few lines that shows the JS function
    being invoked as soon as the page loads (the function just displays an
    alert when called).

    When this page is hit, the JS function automatically gets called three
    times (once for each Tool Tip link in the html) ...



    This is an example of the onmouseover's I'm trying to use -

    onmouseover="th is.T_WIDTH=60;t his.T_SHADOWWID TH=0;this.T_PAD DING=3;this.T_B ORDERWIDTH=1;th is.T_BORDERCOLO R='#000000';
    this.T_BGCOLOR= '#FFFAFA'; return escape(PopCPpic ('image_1.jpg') )"

    This support is invoked by including Walter's JS file and then coding a
    "return escape" to invoke it.

    Any insight anyone might have on why this is happening and/or any
    suggestions on how I might get around the problem are most appreciated.
    Thanks !!
    Steve

  • RobG

    #2
    Re: ToolTip package (Walter Zorn's) performance issue

    fochie wrote:[color=blue]
    > Greetings,[/color]
    [...][color=blue]
    > Any insight anyone might have on why this is happening and/or any
    > suggestions on how I might get around the problem are most appreciated.[/color]

    Check the 500 lines of your referenced script file:

    <URL:"http://mygallery.timeg onebuy.com/wz_tooltip.js">

    your problem lies about line 240 where the script redefines the
    onmouseover function. If all you are using this script for is to make
    a small image appear as a tool tip, write your own function.

    You should be able to do it in a few lines. Ditch the in-line styles
    on each link and put it into a class - resulting in far less code to
    download - but you will have a lag on your mouseover whilst the image
    is retrieved.

    --
    Rob

    Comment

    • fochie

      #3
      Re: ToolTip package (Walter Zorn's) performance issue

      Rob,

      Thanks for your reply. I've taken your advice and bailed on using the
      Walter Zorn ToolTip script since it appears to be somewhat intrusive.
      I've found an example tooltip script from Dynamic Drive that I've been
      able to easily modify/customize to fit my needs. Getting it to co-exist
      with the Walter Zorn Drag/Drop script (which I am somewhat dependant on
      at the moment) was a little challenging, but I seem to have both
      scripts running fine now.

      Thanks again,
      Steve

      Comment

      Working...