Ok I’m stumped. I have been trying to use Simpletip to create a tooltip on click event so that tooltips are useful on a mobile device.
I can’t for the life of me get anything to happen. Have created an example at http://jsfiddle.net/JrDYN/5/ of the unsuccessful attempt.
Is anyone able to spot why this doesn’t work?
Thanks
Greg
You have a couple of issues here. For starters, you’re using object literal syntax inside the call to
hoverbut the code you’re passing in is a function body:And you had a typo in the
simpletipcall (the S was capitalized). This works in the jsFiddle example:Here’s an updated version of your jsFiddle.
For future reference, the way I figured this out was to pull up Chrome’s developer tools (hit F12) and look at the console tab. Chrome was reporting a syntax error. That helped me spot the missing
functionkeyword.Once I had that in place, I was still getting an error, so I commented out the call to
simpletipand the error went away. Bingo, syntax error in thesimpletipsection, an object didn’t exist. A quick peek at the documentation confirmed that thesimpletipcall needed to be capitalized. There you have it.