Chromium SVG hover tooltip weirdness</a></h1> </div> <div class="grid fw-wrap pb8 mb16 bb bc-black-075"> <div class="grid--cell ws-nowrap mr16 mb8" title="2016-01-12 19:07:53Z"> <span class="fc-light mr2">Asked</span> <time itemprop="dateCreated" datetime="2012-10-06T14:58:54.613" class="fromnow">Oct 06 '12 at 14:58</time> </div> <div class="grid--cell ws-nowrap mr16 mb8"> <span class="fc-light mr2">Active</span> <time class="fromnow" title="2012-10-06T18:13:15.143" datetime="2012-10-06T18:13:15.143">Oct 06 '12 at 18:13</a> </div> <div class="grid--cell ws-nowrap mb8" title="Viewed 3,373 times"> <span class="fc-light mr2">Viewed</span> 3,373 times </div> </div> <div id="mainbar" role="main" aria-label="questions and answers"> <div id="question" class="question" data-questionid="12760886" data-ownerid="674683" data-score="3"> <div class="post-layout"> <div class="votecell post-layout--left"> <div class="js-voting-container grid jc-center fd-column ai-stretch gs4 fc-black-200" data-post-id="12760886"> <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"></path></svg></button> <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="3">3</div> <button class="js-bookmark-btn s-btn s-btn__unset c-pointer py4"> <svg aria-hidden="true" class="svg-icon iconBookmark" width="18" height="18" viewBox="0 0 18 18"><path d="M6 1a2 2 0 00-2 2v14l5-4 5 4V3a2 2 0 00-2-2H6zm3.9 3.83h2.9l-2.35 1.7.9 2.77L9 7.59l-2.35 1.7.9-2.76-2.35-1.7h2.9L9 2.06l.9 2.77z"></path></svg> <div class="js-bookmark-count mt4" data-value=""></div> </button> </div> </div> <div class="postcell post-layout--right"> <div class="s-prose js-post-body" itemprop="text"><p>In many browsers, hover mousepointer over an SVG object with a nested <code><title></code> and the title text appears as a tooltip. I'm discovering something strange happens in Chrome if adjacent objects have the same title: the tooltip is not redisplayed when you mouseover from one object to the other. </p> <p>This can be replicated with the following code/fiddle. In IE, you get a fresh tooltip for each object.</p> <p>How can I work around this issue? I need to use Chromium and I need the same tooltip to reappear over adjacent objects. I don't really want to get into (more) scripting unless it can be done in a super lightweight, reliable and flawless with SVG. </p> <p>Perhaps I can embed something invisible into the title text to make Chromium think each object's title is different?</p> <pre><code><svg xmlns="http://www.w3.org/2000/svg" version="1.1"> <rect x="0" y="0" width="100" height="100" fill="yellow" stroke="black"> <title>square</title> </rect> <rect x="100" y="0" width="100" height="100" fill="yellow" stroke="black"> <title>square</title> </rect> <rect x="0" y="100" width="100" height="100" fill="yellow" stroke="black"> <title>square</title> </rect> <rect x="100" y="100" width="100" height="100" fill="yellow" stroke="black"> <title>SQUARE</title> </rect> </svg> </code></pre> <p><a class="external-link" href="http://jsfiddle.net/CvZfR/" rel="nofollow">http://jsfiddle.net/CvZfR/</a></p></div> <div class="mt24 mb12"> <div class="post-taglist grid gs4 gsy fd-column"> <div class="grid ps-relative"> <a href="../../questions/tagged/google-chrome" class="post-tag js-gps-track" title="show questions tagged 'google-chrome'" rel="tag">google-chrome</a> <a href="../../questions/tagged/svg" class="post-tag js-gps-track" title="show questions tagged 'svg'" rel="tag">svg</a> <a href="../../questions/tagged/hover" class="post-tag js-gps-track" title="show questions tagged 'hover'" rel="tag">hover</a> <a href="../../questions/tagged/tooltip" class="post-tag js-gps-track" title="show questions tagged 'tooltip'" rel="tag">tooltip</a> <a href="../../questions/tagged/chromium" class="post-tag js-gps-track" title="show questions tagged 'chromium'" rel="tag">chromium</a> </div> </div> </div> <div class="mb0"> <div class="mt16 grid gs8 gsy fw-wrap jc-end ai-start pt4 mb16"> <div class="grid--cell mr16 fl1 w96"></div> <div class="post-signature owner grid--cell"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="asked Oct 06 '12 at 14:58">asked Oct 06 '12 at 14:58</time> <a href="../../users/674683/paperjam" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/674683.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="paperjam" /> </a> <div class="s-user-card--info"> <a href="../../users/674683/paperjam" class="s-user-card--link">paperjam</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">8,321</li> <li class="s-award-bling s-award-bling__gold" title="12 gold badges">12</li> <li class="s-award-bling s-award-bling__silver" title="53 silver badges">53</li> <li class="s-award-bling s-award-bling__bronze" title="79 bronze badges">79</li> </ul> </div> </div> </div> </div> </div> </div> <div class="post-layout--right js-post-comments-component"> </div> </div> </div> <div id="answers"> <a name="tab-top"></a> <div id="answers-header"> <div class="answers-subheader grid ai-center mb8"> <div class="grid--cell fl1"> <h2 class="mb0" data-answercount="9">2 Answers<span style="display:none;" itemprop="answerCount">2</span></h2> </div> </div> </div> <a name="12762469"></a> <div id="answer-12762469" class="answer accepted-answer" data-answerid="12762469" data-ownerid="674683" data-score="2" itemprop="acceptedAnswer" itemscope="" itemtype="https://schema.org/Answer"> <div class="post-layout"> <div class="votecell post-layout--left"> <div class="js-voting-container grid jc-center fd-column ai-stretch gs4 fc-black-200" data-post-id="12762469"> <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"></path></svg></button> <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="2">2</div> <div class="js-accepted-answer-indicator grid--cell fc-green-500 py6 mtn8"><div class="ta-center"><svg aria-hidden="true" class="svg-icon iconCheckmarkLg" width="36" height="36" viewBox="0 0 36 36"><path d="m6 14 8 8L30 6v8L14 30l-8-8v-8z"></path></svg></div></div> </div> </div> <div class="postcell post-layout--right"> <div class="s-prose js-post-body" itemprop="text"><p>I found one approach that works: put some <code>&zwnj;</code> or <code>&zwj;</code> into the title text. These are zero-width invisible characters. Different combinations of these make the title look different to Chromium.</p></div> <div class="mb0"> <div class="mt16 grid gs8 gsy fw-wrap jc-end ai-start pt4 mb16"> <div class="grid--cell mr16 fl1 w96"></div> <div class="post-signature owner grid--cell"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="answered Oct 06 '12 at 18:13">answered Oct 06 '12 at 18:13</time> <a href="../../users/674683/paperjam" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/674683.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="paperjam" /> </a> <div class="s-user-card--info"> <a href="../../users/674683/paperjam" class="s-user-card--link">paperjam</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">8,321</li> <li class="s-award-bling s-award-bling__gold" title="12 gold badges">12</li> <li class="s-award-bling s-award-bling__silver" title="53 silver badges">53</li> <li class="s-award-bling s-award-bling__bronze" title="79 bronze badges">79</li> </ul> </div> </div> </div> </div> </div> </div> <div class="post-layout--right js-post-comments-component"> </div> </div> </div> <a name="12761303"></a> <div id="answer-12761303" class="answer " data-answerid="12761303" data-ownerid="1630963" data-score="0" itemprop="suggestedAnswer" itemscope="" itemtype="https://schema.org/Answer"> <div class="post-layout"> <div class="votecell post-layout--left"> <div class="js-voting-container grid jc-center fd-column ai-stretch gs4 fc-black-200" data-post-id="12761303"> <button class="js-vote-up-btn grid--cell s-btn s-btn__unset c-pointer"><svg aria-hidden="true" class="m0 svg-icon iconArrowUpLg" width="36" height="36" viewBox="0 0 36 36"><path d="M2 26h32L18 10 2 26z"></path></svg></button> <div class="js-vote-count grid--cell fc-black-500 fs-title grid fd-column ai-center" itemprop="upvoteCount" data-value="0">0</div> </div> </div> <div class="postcell post-layout--right"> <div class="s-prose js-post-body" itemprop="text"><p>I guess it's probably a bit heavy for your needs, also you'd have to implement a way of disabling the default tooltip display.</p> <p>Given that css doesn't seem to do that job, a post in the thread here: <a href="../../questions/1027762/how-to-disable-tooltip-in-the-browser-with-jquery">How to disable tooltip in the browser with jQuery?</a> makes the suggestion that title attributes could be renamed aTitle, or something similar. Since these are actually contained within title tags, as opposed to title attributes of the rect elements, I guess you could (1) create new element, (2) copy contents of title (3) append new element before old one, (4) remove old element.</p> <p>Though, I don't know if you can document.createElement('aTitle') - I can't remember if that fails or not.</p> <p>Anyhoo - jsfiddle here: <a class="external-link" href="http://jsfiddle.net/CvZfR/25/" rel="nofollow noreferrer">http://jsfiddle.net/CvZfR/25/</a></p></div> <div class="mb0"> <div class="mt16 grid gs8 gsy fw-wrap jc-end ai-start pt4 mb16"> <div class="grid--cell mr16 fl1 w96"></div> <div class="post-signature grid--cell"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="edited May 23 '17 at 12:04">edited May 23 '17 at 12:04</time> <a href="../../users/-1/community" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/-1.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="Community" /> </a> <div class="s-user-card--info"> <a href="../../users/-1/community" class="s-user-card--link">Community</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">1</li> <li class="s-award-bling s-award-bling__silver" title="1 silver badges">1</li> </ul> </div> </div> </div> <div class="post-signature grid--cell"> <div class="s-user-card s-user-card"> <time class="s-user-card--time" datetime="answered Oct 06 '12 at 15:56">answered Oct 06 '12 at 15:56</time> <a href="../../users/1630963/enhzflep" class="s-avatar s-avatar__32 s-user-card--avatar"> <img class="s-avatar--image" src="../../users/profiles/1630963.webp" data-jdenticon-width="32" data-jdenticon-height="32" data-jdenticon-value="enhzflep" /> </a> <div class="s-user-card--info"> <a href="../../users/1630963/enhzflep" class="s-user-card--link">enhzflep</a> <ul class="s-user-card--awards"> <li class="s-user-card--rep" title="reputation score">12,927</li> <li class="s-award-bling s-award-bling__gold" title="2 gold badges">2</li> <li class="s-award-bling s-award-bling__silver" title="32 silver badges">32</li> <li class="s-award-bling s-award-bling__bronze" title="51 bronze badges">51</li> </ul> </div> </div> </div> </div> </div> </div> <div class="post-layout--right js-post-comments-component"> </div> </div> </div> </div> </div> </div> </div> <script src="../../static/js/stack-icons.js"></script> <script src="../../static/js/fromnow.js"></script> </body> </html>