By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,281 Members | 2,216 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,281 IT Pros & Developers. It's quick & easy.

Guitar Chord onHover-like effect

P: n/a
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.

ch**********@eastontario.comNOSPAM
Jul 20 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I get the warning d11 does not exist for line if (isIE)..

function initThis()
{
if(isNS4)skn=document.d11;
if(isIE)skn=document.all.d11.style;
if(isNS6)skn=document.getElementById("d11").style;
}
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" <no*@eastontario.com> wrote in message
news:5E*********************@news20.bellglobal.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.
:
: ch**********@eastontario.comNOSPAM
:
:
Jul 20 '05 #2

P: n/a
DJ WIce wrote:
I get the warning d11 does not exist for line if (isIE)..

function initThis()
{
if(isNS4)skn=document.d11;
if(isIE)skn=document.all.d11.style;
if(isNS6)skn=document.getElementById("d11").style;
}
You clould use here
if..
else if..
else if
it does not solve any problem, it's just that the testing may go faster.
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.
maybe you need to change

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

to

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


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.

http://www.jibbering.com/faq/#FAQ4_40

With regards to eval.

http://www.jibbering.com/faq/#FAQ2_3

With regards to quoting/posting.

http://www.jibbering.com/faq/#FAQ4_26

With regards to "browser detection"

http://www.jibbering.com/faq/

With regards to javascript in general. It could be helful reading for
you, and the OP as well.
--
Randy
Chance Favors The Prepared Mind

Jul 20 '05 #3

P: n/a
"DJ WIce" <co*********@djwice.com> wrote in message
news:bu**********@news.tudelft.nl...
<snip>
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.

<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.
Jul 20 '05 #4

P: n/a
DJ WIce wrote:
I get the warning d11 does not exist for line if (isIE)..

function initThis()
{
if(isNS4)skn=document.d11;
if(isIE)skn=document.all.d11.style;
if(isNS6)skn=document.getElementById("d11").style;
}
You clould use here
if..
else if..
else if
it does not solve any problem, it's just that the testing may go faster.

Possibly, a better way yet, is:

if(document.getElementById)
skn = document.getElementById("d11").style;
else if(document.all)
skn = document.all.d11.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)
....
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.


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

Jul 20 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.