Having Trouble with jQuery tooltips -
i'm using jquery tools tooltip plugin found here. it's intended behavior: have 3 elements, in case div
s, which, when clicked, popup tooltip. tooltip div on page hidden via css. when pops out, need stay visible until either user clicks on 1 of div
s in tooltip (or inside tooltip if not possible) or click on 1 of other initial 3 div
s.
the problem: unexpected behavior when doing this. example, first div
click (no matter one), works expected: tooltip pops , stays unless click inside of or 1 of other div
s. however, when doing again div
, disappears once mouse leaves div
area. can still click on first 1 clicked on no problems tho...
i'm not sure what's wrong here. =/
test code below
<!doctype html public "-//w3c//dtd xhtml 1.0 transitional//en" "http://www.w3.org/tr/xhtml1/dtd/xhtml1-transitional.dtd"> <html xmlns='http://www.w3.org/1999/xhtml' xml:lang='en' lang='en' dir='ltr'> <head> <title>tool tip demo</title> <link rel='stylesheet' type='text/css' href='style/style.css' /> <script type='text/javascript' src='jquery.js'></script> <script type='text/javascript' src='jquery.tools.min.js'></script> <style> .box2 { display: inline-block; margin: 5px; padding: 3px; width: 64px; height: 64px; line-height: 64px; background-color: green; text-align: center; } #tooltip { display: none; width: 300px; height: 150px; overflow: auto; background-color: pink; } </style> </head> <body> <h1>tool tip demo</h1> <script language='javascript' type='text/javascript'> $(document).ready(function () { $('.tooltip').tooltip({ events: { def: "click, mouseout", tooltip: "mouseenter, click" }, tip: '#tooltip'}).dynamic({ bottom: { direction: 'down'} }); }); </script> <div style='padding: 1em; width: 450px; margin: 0 auto;'> <div class='tooltip box2'> div </div> <div class='tooltip box2'> div </div> <div class='tooltip box2'> div </div> </div> <div id='tooltip'> <div class='box2'> div </div> <div class='box2'> div </div> <div class='box2'> div </div> <div class='box2'> div </div> <div class='box2'> div </div> <div class='box2'> div </div> <div class='box2'> div </div> <div class='box2'> div </div> <div class='box2'> div </div> </div> </body> </html>
Comments
Post a Comment