Hi!
I am building an image-function with a mouseover-effect, but I need some help. On my page I have four images, and each image exists in three sizes (large, medium and small). When the page is launched, it shows one image of medium size and three of the small size. What I want to do is the following;
When I put my mouse icon over one of the small images, I want the source of the medium image to change to the selected small image (but it's medium version). When I put my mouse icon away, I want the default medium image to appear again. I also want the medium size image to link to the large size version of the same image, using a hyperlink. When I select one of the small images, I want the hyperlink source of the medium image to change so it links to the large version of the selected small image as well.
Here's what I've got so far:
Default.aspx:
Code:
<asp:HyperLink ID="Medium" runat="server">
<asp:Image runat="server" ID="imgMedium" />
</asp:HyperLink>
<asp:HyperLink ID="Small1" runat="server">
<asp:Image runat="server" ID="imgSmall1" />
</asp:HyperLink>
<asp:HyperLink ID="Small2" runat="server">
<asp:Image runat="server" ID="imgSmall2" />
</asp:HyperLink>
<asp:HyperLink ID="Small3" runat="server">
<asp:Image runat="server" ID="imgSmall3" />
</asp:HyperLink>
Default.aspx.
vb:
Code:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
imgMedium.ImageUrl = "img1medium.jpg"
imgSmall1.ImageUrl = "img2small.jpg"
imgSmall1.Attributes.Add("name", imgSmall1.ClientID)
Small1.NavigateUrl = "img2large.jpg"
Small1.Attributes.Add("onMouseOver", imgMedium.ClientID & ".src='img2medium.jpg'; window.status='Mouse Over'; return true;")
Small1.Attributes.Add("onMouseOut", imgMedium.ClientID & ".src='img1medium.jpg'; window status=' '; return true;")
Select imgMedium.ImageUrl
Case imgMedium.ImageUrl = "img1medium.jpg"
Medium.NavigateUrl = "img1large.jpg"
Case imgMedium.ImageUrl = "img2medium.jpg"
Medium.NavigateUrl = "img2large.jpg"
End Select
End Sub
I believe this is possible but I can't figure it out. Help would be much appreciated! =)