jquery 实现鼠标悬浮在某控件上,显示详细信息
<head id="Head1" runat="server"> <title></title> <style type="text/css"> #livetip { position: absolute; background-color: #cfc; padding: 4px; border: 2px solid #9c9; -webkit-border-radius: 4px; -moz-border-radius: 4px; } </style> <script type="text/javascript" src="../Scripts/jquery-1.4.1.min.js"></script> <script type="text/javascript"> jQuery(function ($) { var $liveTip = $('<div id="livetip"></div>').hide().appendTo('body'); var tipTitle = ''; $('#myDiv').bind('mouseover mouseout', function (event) { var $link = $(event.target).closest('input'); if ($link.length < 1) { return; } var link = $link[0]; if (event.type == 'mouseover') { $liveTip.css({ top: event.pageY, left: event.pageX }); link.title = ''; $liveTip.html('<div>' + link.value + '</div>').show(); }; if (event.type == 'mouseout') { $liveTip.hide(); if (tipTitle) { link.title = tipTitle; }; }; }); }); </script> </head> <body> <div id="myDiv"> <input id="radio1" type="radio" value="Blue" name="radio1">Blue</input> <input id="radio2" type="radio" value="White" name="radio1">White</input> <input id="radio3" type="radio" value="Red" name="radio1">Red</input> </div> </body>
相关推荐
honeyth 2020-09-13
delmarks 2020-06-28
mjshldcsd 2020-08-15
Ping 2020-08-15
Kakoola 2020-08-01
Yellowpython 2020-08-01
chenguangchun 2020-07-26
dailinqing 2020-07-18
xiaouncle 2020-07-05
MayerF 2020-06-14
MrHaoNan 2020-06-13
smalllove 2020-06-09
JayFighting 2020-06-08
xiaoge00 2020-06-07
haokele 2020-05-31
matthewhan 2020-05-25
Alanxz 2020-05-20
82550495 2020-05-19