开发者

get a tooltip when hovering over a select list option using jquery

I need a jQuery plugin that can show the option's text as a tooltip when we hover over a selectlist which has multiple select enabled. Else, can we do it manually.. if so can you give me some samples.

[edit] I am using IE 8 and need this to work across all browsers [IE, Chrome, 开发者_Python百科FF, Safari].


There is some good tooltip. You can modify it to fit your needs.

This is how you can get current hovering option (jsfiddle):

HTML

<select height="2">
    <option>hello</option>
    <option>by</option>
</select>

JS

$('select option').hover( function(){ 
        console.log( 'Hover on:' + $(this).html() ) 
    }, function(){
        console.log( 'Hover off from:' + $(this).html() )
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜