本文介绍了如何在图像上写入mouseover和mouseout事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
<%@ Page Language="VB" MasterPageFile="~/M1.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" title="Untitled Page" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
<script type="text/javascript" >
function showIt(imgsrc) {
var Image_over = new Image();
var Image_over1=new Image();
Image_over.src = imgsrc.src;
Image_over1.src=imgsrc.src;
var Image1 = document.getElementById("<%=Img1.ClientID%>");
Image1.src = Image_over.src;
out()
}
function out(imgsrc)
{
var Image_over1=new Image();
var Image2 = document.getElementById("<%=Img2.ClientID%>");
Image2.src=Image_over1.src;
}
function cancelIt(imgsrc)
{
var image_out=new Image();
image_out.src=imgsrc.src;
image_out1.src=imgsrc.src;
var image1=document.getElementById("<%=Img1.ClientID %>");
image1.src=image_out.src;
ins()
}
//
function ins(imgsrc)
{
var image_out=new Image();
var image2 = document.getElementById("<%=Img2.ClientID%>");
image2.src=image_out.src;
}
// if (document.images) {
// image1on = new Image();
// image1on.src="name of your "on" image";
// image1off = new Image();
// image1off.src = "name of your "off" image";
//}
//function turnOn(imageName) {
// if (document.images) {
// document[imageName].src = eval(imageName + "on.src");
// }
//}
//function turnOff(imageName) {
// if (document.images) {
// document[imageName].src = eval(imageName + "off.src");
// }
//}
function IsMobile(sender,e)
{
e.IsValid = true;
var Mob=e.Value;
if(Mob=='END' || Mob=='end')
{
e.IsValid=true;
}
else
{
MyExp=/^([9|8]{1}+\d{9})$/;
e.IsValid= MyExp.test(Mob)
}
//
//function bigImg(x)
//{
//x.style.height="200px";
//x.style.width="200px";
//}
//function normalImg(x)
//{
//x.style.height="98px";
//x.style.width="153px";
//}
}
</script>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<p>
<table style="width: 100%; margin-top: 9px;">
<tr>
<td style="width: 286px">
<asp:Label ID="Label1" runat="server" Font-Bold="True" Text="SL.NO"></asp:Label>
<asp:TextBox
ID="txtslno" runat="server" Height="16px" style="margin-left: 0px"
Width="123px"></asp:TextBox>
</td>
<td style="width: 267px">
<asp:Label ID="Label2" runat="server" Font-Bold="True" Text="NAME"></asp:Label>
<asp:TextBox ID="txtname" runat="server"
Height="19px" Width="124px"></asp:TextBox>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td style="width: 286px">
<asp:Label ID="Label3" runat="server" Font-Bold="True" Text="ADDRESS"></asp:Label>
<asp:TextBox
ID="txtaddr" runat="server" Height="17px" Width="130px"
TextMode="MultiLine"></asp:TextBox>
</td>
<td style="width: 267px">
<asp:Label ID="Label4" runat="server" Font-Bold="True" Text="LANDLINE"></asp:Label>
<asp:TextBox ID="txtlan" runat="server" Height="17px" Width="24px"></asp:TextBox>
<cc1:FilteredTextBoxExtender ValidChars="0123456789" ID="FilteredTextBoxExtender11"
runat="server" TargetControlID="txtlan" FilterType="Numbers">
</cc1:FilteredTextBoxExtender>
<asp:TextBox ID="txtlandl" runat="server"
Height="18px" Width="127px"></asp:TextBox>
<cc1:FilteredTextBoxExtender ValidChars="0123456789" ID="FilteredTextBoxExtender18"
runat="server" TargetControlID="txtlandl" FilterType="Numbers">
</cc1:FilteredTextBoxExtender>
</td>
</td>
<td>
<asp:Label ID="Label5" runat="server" Font-Bold="True" Text="MOBILE"></asp:Label>
<asp:TextBox ID="txtmbl" runat="server" Height="21px" Width="126px"></asp:TextBox>
<asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" ErrorMessage="Enter Mobile No. (Authorized Representative)"
ControlToValidate="txtmbl" ToolTip="Enter Mobile No">*</asp:RequiredFieldValidator>
<cc1:FilteredTextBoxExtender ValidChars="0123456789" ID="FilteredTextBoxExtender53"
runat="server" TargetControlID="txtmbl" FilterType="Numbers">
</cc1:FilteredTextBoxExtender>
<asp:CustomValidator runat="server" ID="CustomMobile" ControlToValidate="txtmbl"
ClientValidationFunction="IsMobile" ErrorMessage="Mobile Number Should Start with 9/8/7"
ToolTip="Mobile Number Should Start with 9/8/7">*</asp:CustomValidator>
</td>
<td>
</td>
</tr>
<tr>
<td style="width: 286px">
<asp:Button ID="Button1" runat="server" Font-Bold="True" Text="NEW" />
</td>
<td style="width: 267px">
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td style="width: 286px">
</td>
<td style="width: 267px">
<asp:Image ID="Img1" runat="server" Height="94px" ImageUrl="~/yellow1.jpg"
Width="104px" style="margin-top: 0px" />
</td>
<td>
<asp:Image ID="Img2" runat="server" ImageUrl="~/mobile.bmp" />
</td>
<td>
</td>
</tr>
<tr>
<td style="width: 286px">
</td>
<td style="width: 267px">
</td>
<td>
</td>
<td>
</td>
</tr>
</table>
</p>
</asp:Content>
推荐答案
这篇关于如何在图像上写入mouseover和mouseout事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!