Guitar Chord onHover-like effect

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

    Guitar Chord onHover-like effect

    Stuck with a problem.


    "View Source" of course.

    This might be a boon for the guitar teachers/students.
    When you pass the mouse pointer over Chord letter link, holding it there for
    the downloading of images, eventually diagram open to assist beginners.

    How does one preload those images?

    Also I might be in need of the redrawing of the picture files involved,
    since I've not yet received permission from an originating page.

    Anyone out there care to do some charity work for a GNU project?

    Surely many wish to help pay back some of the debt they owe to such as
    metapad.
    Finished product to be posted for free - mirrors appreciated.
    Documentation of improvements welcome.

    Assistance making this compatible with older versions of Netscape also
    appreciated in the useful "thanks, the world is a better place for you" and
    an "e-handshake" sort of way.

    chordsNOSPAM@ea stontario.comNOSPAM


  • DJ WIce

    #2
    Re: Guitar Chord onHover-like effect

    I get the warning d11 does not exist for line if (isIE)..

    function initThis()
    {
    if(isNS4)skn=do cument.d11;
    if(isIE)skn=doc ument.all.d11.s tyle;
    if(isNS6)skn=do cument.getEleme ntById("d11").s tyle;
    }


    You clould use here
    if..
    else if..
    else if
    it does not solve any problem, it's just that the testing may go faster.

    maybe you need to change

    images[i].src = "p" + i + ".gif";

    to

    images[i].src = eval("p" + i + ".gif");

    I get an error for that line too.


    I use MSIE6 on XP, I see the chords, but the first time it's a bit strange.
    This might be because of the above images[i]..

    Succes,
    Wouter





    "Gord Murray" <nov@eastontari o.com> wrote in message
    news:5EIPb.1557 6$U77.1199989@n ews20.bellgloba l.com...
    : Stuck with a problem.
    :
    : http://eastontario.com/guitar/onHover.htm
    : "View Source" of course.
    :
    : This might be a boon for the guitar teachers/students.
    : When you pass the mouse pointer over Chord letter link, holding it there
    for
    : the downloading of images, eventually diagram open to assist beginners.
    :
    : How does one preload those images?
    :
    : Also I might be in need of the redrawing of the picture files involved,
    : since I've not yet received permission from an originating page.
    :
    : Anyone out there care to do some charity work for a GNU project?
    :
    : Surely many wish to help pay back some of the debt they owe to such as
    : metapad.
    : Finished product to be posted for free - mirrors appreciated.
    : Documentation of improvements welcome.
    :
    : Assistance making this compatible with older versions of Netscape also
    : appreciated in the useful "thanks, the world is a better place for you"
    and
    : an "e-handshake" sort of way.
    :
    : chordsNOSPAM@ea stontario.comNOSPAM
    :
    :


    Comment

    • Randy Webb

      #3
      Re: Guitar Chord onHover-like effect

      DJ WIce wrote:
      [color=blue]
      > I get the warning d11 does not exist for line if (isIE)..
      >
      > function initThis()
      > {
      > if(isNS4)skn=do cument.d11;
      > if(isIE)skn=doc ument.all.d11.s tyle;
      > if(isNS6)skn=do cument.getEleme ntById("d11").s tyle;
      > }
      >
      >
      > You clould use here
      > if..
      > else if..
      > else if
      > it does not solve any problem, it's just that the testing may go faster.[/color]

      very very marginally. Only the time it takes NS4 to execute, and fail,
      the last two tests. For IE, it will only speed it up for the time it
      takes to execute the last test. For NS6, it won't speed it up at all.

      But from the looks of what you quoted, the OP is using browser detection
      and wherever he learned that technique, he needs to black-mark it and
      never return to it. And find a good site to learn from.
      [color=blue]
      > maybe you need to change
      >
      > images[i].src = "p" + i + ".gif";
      >
      > to
      >
      > images[i].src = eval("p" + i + ".gif");[/color]

      maybe you need to learn how to script.

      if i contains the number 11, both lines will resolve to this:

      images[11].src = "p11.gif"; //a string in both instances.

      Which makes the eval both unneeded and useless.



      With regards to eval.



      With regards to quoting/posting.



      With regards to "browser detection"



      With regards to javascript in general. It could be helful reading for
      you, and the OP as well.


      --
      Randy
      Chance Favors The Prepared Mind

      Comment

      • Richard Cornford

        #4
        Re: Guitar Chord onHover-like effect

        "DJ WIce" <contextmenu@dj wice.com> wrote in message
        news:buo5ou$5s1 $1@news.tudelft .nl...
        <snip>[color=blue]
        > maybe you need to change
        >
        > images[i].src = "p" + i + ".gif";
        >
        > to
        >
        > images[i].src = eval("p" + i + ".gif");
        >
        > I get an error for that line too.[/color]
        <snip>

        You would! If you don't understand how the - eval - function works you
        should not use it, and you certainly should not ever recommend its use
        to anyone else.

        <URL: http://jibbering.com/faq/FAQ4_40 >

        Richard.


        Comment

        • Brian Genisio

          #5
          Re: Guitar Chord onHover-like effect

          DJ WIce wrote:
          [color=blue]
          > I get the warning d11 does not exist for line if (isIE)..
          >
          > function initThis()
          > {
          > if(isNS4)skn=do cument.d11;
          > if(isIE)skn=doc ument.all.d11.s tyle;
          > if(isNS6)skn=do cument.getEleme ntById("d11").s tyle;
          > }
          >
          >
          > You clould use here
          > if..
          > else if..
          > else if
          > it does not solve any problem, it's just that the testing may go faster.
          >[/color]

          Possibly, a better way yet, is:

          if(document.get ElementById)
          skn = document.getEle mentById("d11") .style;
          else if(document.all )
          skn = document.all.d1 1.style;
          else if(document.d11 )
          skn = document.d11;
          else
          // error

          The reason I say this, is because it is very dangerous to check for
          browser versions... changes in browsers in the future can make the code
          break. Instead, you check for the capability. You can store the
          capabilities up front, instead of the browser info, and do something like:
          if(HAS_ELEMENT_ BY_ID)
          ....
          [color=blue]
          > maybe you need to change
          >
          > images[i].src = "p" + i + ".gif";
          >
          > to
          >
          > images[i].src = eval("p" + i + ".gif");
          >
          > I get an error for that line too.[/color]

          Hmmmm... I dont think eval fixes anything. There does not seem to be
          anything wrong with this, unless images is not defined (or i).

          Take what I say for what it's worth... nothin,
          Brian

          Comment

          Working...