Skip to content
Browse files

Better handling of overflow e.g. in href

  • Loading branch information...
1 parent 9a744c3 commit 40163dfc7a9f11b2c6888382b66828bc04d12a08 Jason Johnston committed
Showing with 7 additions and 3 deletions.
  1. +2 −2 TitleTip-test.html
  2. +2 −0 TitleTip.css
  3. +3 −1 TitleTip.xml
View
4 TitleTip-test.html
@@ -13,13 +13,13 @@
<p>
This is a bunch of text blah blah blah. This
- <a href="#" title="This link goes to nowhere.">link</a>
+ <a href="#nowhere" title="This link goes to nowhere.">link</a>
should have a title-tip. <acronym title="So Should This Acronym">SSTA</acronym>.
</p>
<p title="This entire paragraph will have a very long titletip. This is to test what will happen when there is a lot of text within a title attribute on an element. It should wrap as necessary to show all the content without scrolling.">This entire paragraph will have a very long titletip.</p>
- <p>This will be a case of nested titled elements: <a href="#" title="outside element">The following words are <strong title="inside element">strongly emphasized</strong> for your convenience.</a></p>
+ <p>This will be a case of nested titled elements: <a href="#nowhere" title="outside element">The following words are <strong title="inside element">strongly emphasized</strong> for your convenience.</a></p>
<p style="position:absolute; top:800px; left:1000px;">forcing scrolling</p>
View
2 TitleTip.css
@@ -16,9 +16,11 @@
font-weight:normal;
color:#000;
background:#FFF;
+ overflow:hidden;
}
.title-tip-href {
display:block;
font-style:italic;
+ overflow:hidden;
}
View
4 TitleTip.xml
@@ -73,7 +73,9 @@
<body><![CDATA[
var thisRef = this;
function length(prop) {
- return parseFloat(getComputedStyle(thisRef, null).getPropertyValue(prop));
+ return thisRef.currentStyle ?
+ thisRef.currentStyle[prop] :
+ parseFloat(getComputedStyle(thisRef, null).getPropertyValue(prop));
}
var x = event.clientX + 12;

0 comments on commit 40163df

Please sign in to comment.
Something went wrong with that request. Please try again.