Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

html make tooltip avaible if text overflow

$('.mightOverflow').bind('mouseenter', function(){
    var $this = $(this);

    if(this.offsetWidth < this.scrollWidth && !$this.attr('title')){
        $this.attr('title', $this.text());
        //OR $this.attr('title', $this.val()); //If using input
    }
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #html #tooltip #avaible #text #overflow
ADD COMMENT
Topic
Name
9+2 =