0

Is there a variety of mouse hover simulation which does make tooltips / bubbles show up? Here is the fiddle in which tries to achieve this effect by modifying the class of a HTML element. It is not working, though, unless you hover manually.

http://jsfiddle.net/tearex/5e4mybok/13/

Here is code

<div id="test"></div>
<table width="70%" border="0" align="center">
            <tr>
                <!--    <td>&nbsp;</td>-->
                    <td>  
                        <div data-role="fieldcontain" width="30%">
                            <fieldset data-role="controlgroup" data-type="horizontal" data-mini="true">
          <legend></legend>

          <input type="radio" id="radio1_1" value="2" accesskey="–" checked  class = hovered/>
            <label for="radio1_1" href="#" title="hovering...">Hover here</label>

                            </fieldset>
                        </div>
                    </td>
            </tr>
        </table>

script

$(document).on('pageinit', function() {


 $("#radio1_1").mouseenter();
theElement.onmouseover = function(){theElement.className += ' hovered'};
 })

CSS

.hover { background-color: #ebebeb;   }

#radio1_1 { border: 1px solid #c3c3c3; width: 200px; height: 200px;}
secr
  • 624
  • 4
  • 9
  • 20
  • just overlooked, there is class = "hover" in the HTML, by the way, to working either. Please ignore it - I am looking for JS / JQM solution. Thanks a lot for your help. – secr Jun 17 '20 at 14:52
  • The question is a little confusing, could you just use CSS :hover to get this? – JaySnel Jun 17 '20 at 14:53
  • What you are trying to do is not a trusted event. Better use same title attribute on radio input as well. https://stackoverflow.com/questions/17226676/how-do-i-simulate-a-mouseover-in-pure-javascript-that-activates-the-css-hover – Aniket Kudale Jun 17 '20 at 15:15
  • Hi Aniket. Thanks for the link. I appreciate the event is not trusted. Essentially, I want a bubble to show up one way or another. Whereas the solutions on the linked page get console to register a trigger, the bubble does not show up. Any way to do that at all? I would not insist on mouse hover being the method, although I can't think of any other. Here is the modified fiddle http://jsfiddle.net/tearex/ham5ypcx/1/ Many thanks – secr Jun 17 '20 at 17:25
  • @Jay. Now I am not sure if I follow. Turning on ccs :hover selector does not result in the text bubble popping up, which is what I want. Aniket has a point in that this is an untrusted type of event - I can see why so. In any case, it would be good to make text bubbles pop up as a way of communicating with the web page visitor / app user. – secr Jun 17 '20 at 17:31

0 Answers0