[pmwiki-users] tooltip

JB jbit at ev1.net
Sat Aug 5 17:36:42 CDT 2006

> >    (:div class=chord chord='F#maj7' :)F#maj7(:divend:)
> >
> >
> > to display something like this in s tooltip:
> >
> >     F#maj7
> >     ******2
> >     ||||||
> >     |*||||

> It seems that http://www.ultimate-guitar.com/tabs/g/george_harrison/my_sweet_lord_crd.htm
> uses javascript to display chords, so this would need defining
> dedicated markup directives which is a bit more work...

I can program in javascript, and I can call a javascript function from a 
pmwiki anchor.  I plan to write a javascript function that will take
"Fmaj7" and 
ouput the 4 lines of text above as a chord picture.  The problem is how
to have 
my function which will dynamically output the 4 lines of code to display
in a tooltip.

I have tried http://www.walterzorn.com/tooltip/tooltip_e.htm, but it
accept a dynamically generated line of text (or so it seems);

To use the javascript I include the following in my config.php:

Markup('chord', 'directives', '/\\(:chord:\\)/', Keep("<script
language='JavaScript' type='text/javascript'

This works but does not dynamically build the tooltip text:

// wiki code below
(:div onmouseover="return escape('some text here works');" :)


This does not work at all:

// wiki code below
(:div onmouseover="return chord('Fm7');" :)


// code aded to  wz_tooltip.js
function chord(achord)
	// I can put code here to dynamically create chord picture

	//line below does not work
        return escape(achord);

> BTW, shouln't be the F7 chord something more like:

NO!  If you look closely above you will see that I specified
an "Fmaj7" chord, not and "F7".  They are two completly different 
animals.  An this is a spcial variation of the "Fmaj7" chord.

> e -x-|---|---|---|---|
> B -x-|---|---|---|---|
> G ---|-x-|---|---|---|
> D -x-|---|---|---|---|
> A ---|---|---|---|---|
> E ---|---|---|---|---|
> and for those interrested, Abdim7 is:
> e ---|---|---|-x-|---|
> B ---|---|---|---|---|
> G ---|---|---|-x-|---|
> D ---|---|---|---|---|
> A ---|---|---|---|-x-|
> E ---|---|---|-x-|---|

More information about the pmwiki-users mailing list