I want to use the jquery-ui built-in icons and change their style when the user pushes them. But I can only do this if they are contained in another element, and this causes an annoying box around them.
For example, this changes the style accordingly, but it completes setting the frame around the image:
$(".help-button").hover ( function() { $(this).toggleClass('ui-state-hover'); }, function() { $(this).toggleClass('ui-state-hover'); } ); <span class="help-button ui-state-default ui-corner-all" style="display: inline-block;"> <span class='ui-icon ui-icon-info' style="display: inline-block;"></span> </span>
This one has the correct image, but it does not change the style (the same JavaScript as above):
<span class="help_button ui-icon ui-icon-info" style="display: inline-block;"></span>
Any suggestions?
Thanks.
source share