如果我将鼠标放在任何按钮上,它将显示其中的所有内容 [英] if i put mouse in any button it will show all the content in it

查看:51
本文介绍了如果我将鼠标放在任何按钮上,它将显示其中的所有内容的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨...

如何编写onmouse事件代码的代码
例如:在这个网站上,如果将鼠标放在家里,它将显示其中的所有内容,这是我的要求,因此如何编写代码

问候
mahesh

hi...

how to write the code for onmouse event code
ex: in this website if put the mouse in home it will display all the content in it this is my requirement so how to write the code

regards
mahesh

推荐答案

Mahesh,

要在鼠标悬停时显示工具提示,您可以使用任何输入标签的title属性.

例子:
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_standard_title [ ^ ]
hi Mahesh,

To show tool tip on mouse over you can use title attribute of any input tag.

example :
http://www.w3schools.com/tags/tryit.asp?filename=tryhtml_standard_title[^]


下载此文件...........
http://www.menucool.com/tooltip/src/prod/Tooltip.zip [ ^ ]

下载源代码(CSS文件和JavaScript)


将提取的文件放入您的网站,然后将以下两个链接添加到< head>您要在其中使用工具提示的页面部分.

Download this file...........
http://www.menucool.com/tooltip/src/prod/Tooltip.zip[^]

Download the source code (CSS file and JavaScript)


Put the extracted files into your site, and add the following two links into the <head> section of the page where you want to use the tooltip.

<link type="text/css" rel="stylesheet" href="Tooltip.css" />
<script type="text/javascript" src="Tooltip.js"></script>




找到触发工具提示的元素,并设置工具提示的客户端事件:

示例:-
< asp:button id ="btn1" runat ="server" text ="ToolTipDemo" cssclass ="tooltip" onmouseover ="tooltip.pop(this,''Hi there'')" xmlns:asp =#unknown" >




Find the element that triggers the tooltip, and set the client event for the tooltip:

Example:-
<asp:button id="btn1" runat="server" text="ToolTipDemo" cssclass="tooltip" onmouseover="tooltip.pop(this,''Hi there'')" xmlns:asp="#unknown">


<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!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>
<script language="Javascript">
<!--
function toggleDiv(id,flagit,s) {
if (flagit=="1"){
if (document.layers) document.layers[''+id+''].visibility = "show"
else if (document.all) document.all[''+id+''].style.visibility = "visible"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
var objFrame=document.getElementById("myframe");
objFrame.src = s;
}
else
if (flagit=="0"){
if (document.layers) document.layers[''+id+''].visibility = "hide"
else if (document.all) document.all[''+id+''].style.visibility = "hidden"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
}
}
//-->


</script>
<style type="text/css">#div1, #div2, #div3 {position:absolute; top: 50; left: 20; width:400; visibility:hidden}</style>


</head>
<body>
    <form id="form1" runat="server">
    <div>
    <a href="#" onMouseOver="toggleDiv('div1',1,'Default2.aspx')" onMouseOut="toggleDiv('div1',0,'Default2.aspx')">Link 1!</a> |
<a href="#" onMouseOver="toggleDiv('div1',1,'Default3.aspx')" onMouseOut="toggleDiv('div1',0,'Default3.aspx')">Link 2</a> |
<a href="#" onMouseOver="toggleDiv('div1',1,'http://www.google.com')" onMouseOut="toggleDiv('div1',0,'http://www.google.com')">Link 3</a>
<div id="div1"><iframe id="myframe" NAME="myframe" src="about:blank" width="400px" height="400px"></iframe></div>

    </div>
    </form>
</body>
</html>




这是代码.希望对您有帮助.




This is the code. I hope it will help you.


这篇关于如果我将鼠标放在任何按钮上,它将显示其中的所有内容的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆