This is just al wrapper for the awesome jQuery tooltipster plugin. Yes, you are right: this plugin will display nice tooltips :D
Wanna see a demo?
Wanna fork yii-tooltipster or tooltipster on github?
Yii 1.1 or above
Just call the widget once:
$this->widget('ext.tooltipster.tooltipster');
By default this will create a simple tooltip for every element with the class tooltipster:
<a href="http://www.yiiframework.com" class="tooltipster" title="This is my link's tooltip message!"> Link </a> <div class="tooltipster" title="This is my div's tooltip message!"> <p>This div has a tooltip when you hover over it!</p> </div>
There are two possible options: the identifier and an options-array.
$this->widget('ext.tooltipster.tooltipster', array( 'identifier'=>'.lolcat', 'options'=>array('position'=>'right') ));
The identifier can be a css class or a id. Also you can use the options-array to submit all options tooltipster can work with (check the docs).
<a href="http://www.yiiframework.com" class="lolcat" title="This tooltip should be on the right side!"> right? </a>
$_default_options = array( 'animation'=>'fade', 'arrow'=>true, 'arrowColor'=>'', 'content'=>'', 'delay'=>'200', 'fixedWidth'=>'0', 'functionBefore'=>'js:function(origin, continueTooltip) { continueTooltip(); }', 'functionAfter'=>'js:function(origin) {}', 'icon'=>'(?)', 'iconTheme'=>'.tooltipster-icon', 'iconDesktop'=>false, 'iconTouch'=>false, 'interactive'=>false, 'interactiveTolerance'=>'350', 'offsetX'=>'0', 'offsetY'=>'0', 'onlyOne'=>true, 'position'=>'top', 'speed'=>'350', 'timer'=>'0', 'theme'=>'.tooltipster-default', 'touchDevices'=>true, 'trigger'=>'hover' );
Total 7 comments
Thank you, DZ-015!
Yes, this was a copy&paste&dontthinkabout-bug. Fixed.
Thank you for the nice widget! The function options in the default values have to start with js: in order to be encoded correctly (i.e. without quotes). Otherwise they are encoded as string not function. The two corresponding lines in the widget $_default_options array have to be like this:
Also I suggest that in the documentation js: has to be added if the user needs to define a custom function in the options array.
Hi bluezed,
i just included this plugin and the code is untouchted. So i think you should ask questions like this on tooltipsters pages, like http://calebjacob.com/tooltipster/ or https://github.com/iamceege/tooltipster
But maybe you can check your html. Please try something like this:
Maybe your div is just not big enough. Especially if it is empty :D
Hi there,
first of all the extension is great! Just what I was looking for.
However, I've got a strange effect here...
I'm using this to call the widget:
Then I have a table and in one column each row has this <div>:
The column in the table has a fixed width so next to most of the entries in the cells there is some free space.
Now when I move the mouse over the free space in a cell the tooltip appears but if I then move it, still within the same cell, over the text then the tooltip disappears. If I move it back into the text-free area the tooltip appears again.
Same thing happens the other way round as well. If I come into the cell onto the text the tooltip appears, move the mouse in the text-free area and the the tooltip disappears.
Is there something I can do through options?
Cheers!
Can you do something so that there is no .git directory in your extension's zip? I think it won't be of any use for anyone :).
PS: Extension works flawlessly. Great job!
Hello Thanasis,
i'm glad you like this extension!
The 'theme'-option won't load anything by default. It just sets a CSS class! Nothing else.
If you want to use themes, just copy the content from 'tooltipster-light.css' into 'tooltipster.css'.
Greetings
Thank you for this extension. I didn't know about tooltipster before, it's a great plugin. I have one feature request... if you pass eg
to the options so that tooltipster uses another theme, the file 'tooltipster-light.css' is not loaded automatically by the extension. Is it possible to implement this;
Leave a comment
Please login to leave your comment.