We would like to know how to detect text-overflow.
<!DOCTYPE html>
<html>
<head>
<style type='text/css'>
#email {<!-- w w w .jav a 2s.c o m-->
display: inline-block;
width: 100px;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
<script type='text/javascript'>
window.onload=function(){
var e = document.getElementById('email');
if (0 > e.clientWidth - e.scrollWidth) {
console.log("Overflow")
}
}
</script>
</head>
<body>
<span id="email">dave@davemail.dave</span>
</body>
</html>
The code above is rendered as follows: