选项列表鼠标悬停事件显示工具提示 [英] options list mouseover event show tooltip
问题描述
如何在下拉列表鼠标悬停事件中添加带有下拉列表文本的工具提示文本。
我创建了它。但每次都显示旧值。
我使用的是mvc4, html5和knockout.js
self.showTooltip = function(){
var tooltip = document.getElementById('SelectTooltip');
tooltip.innerHTML = $(#timezone)。children(:selected)。text()// $(#timezone)。find(:selected)。each( function();
tooltip.style.display ='block';
}
( #timezone )的儿童(:选择了 )文本()//
( #时区 )发现(:选择了)每个(函数();
tooltip.style.display ='block';
}
使用此代码
<%@ P.年龄 语言 = C# AutoEventWireup = true CodeFile = Default6.aspx.cs 继承 = Default6 %>
< !DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns = http://www.w3.org/1999/xhtml >
< head runat = server >
< title > < / title >
< script type = text / javascript src = Script / jquery-1.7.2.min.js > < / < span class =code-leadattribute> script >
& lt; script language = javascript type = text / javascript > 跨度>
How to add tooltip text with dropdownlist text on dropdownlist mouseover event.
I have created it.But is show old value every time.
I am using mvc4,html5 and knockout.js
self.showTooltip = function () {
var tooltip = document.getElementById('SelectTooltip');
tooltip.innerHTML = $("#timezone").children(":selected").text()//$("#timezone").find(":selected").each(function();
tooltip.style.display = 'block';
}
("#timezone").children(":selected").text()//
("#timezone").find(":selected").each(function();
tooltip.style.display = 'block';
}
Use this code
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default6.aspx.cs" Inherits="Default6" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> <script type="text/javascript" src="Script/jquery-1.7.2.min.js"></script> <script language="javascript" type="text/javascript">
这篇关于选项列表鼠标悬停事件显示工具提示的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!