The following code only executes the color change. I never see the image.
I am writing this in C# ASP.Net in Visual Studio 2017
Basically tried variations of this code.
<asp:LinkButton ID="LinkButton1" Font-Underline="true" runat="server"
OnMouseOver="mouseOver();" OnMouseOut="mouseOut();">Facility
ID</asp:LinkButton>
<img src="../Images/invoice.PNG" id="image1" alt="Image Not Found"
width="1000" height="500" style="display:none;" runat="server" />
<script src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script>
document.getElementById("LinkButton1").onmouseover = function()
{mouseOver()};
document.getElementById("LinkButton1").onmouseout = function()
{mouseOut()};
function mouseOver() {
document.getElementById("LinkButton1").style.color = "red";
document.getElementById("LinkButton1").style.display="inline";
document.getElementById("LinkButton1").src = '../Images/invoice.PNG';
}
function mouseOut() {
document.getElementById("LinkButton1").style.color = "black";
}
</script>
I expect to see the image show like a callout or popup. The text changes to red and the page only indicates javascript:__doPostBack('LinkButton1','')
I think I may see your issue. On this line
you appear to be trying to update the src of the button and not the image.
Try updating your code to use the id of the img tag like this
EDIT1 Ok I am adding in now so when you mouseover the button the image is available and when you mouse out the image goes away. I am doing this using the css visibility property.We set the image to hidden by default inline on the element using the style attribute. When you mouseover the button we set the visible property to visible and when you mouse out we set it back to hidden.
Here is the code to do so
I have also updated the gitub example with the new code and placed it into a file title index2.html which you can view here.