Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
i want to display image of employee on an image area. when i put mouse over a hyper link/link button it should take parameters as employee id,
and display its image. when i take mouse away it should clear the image area/hide image.
for example
i have written a code behind function to show the employee picture when i click button against the employee. it takes its empid and retrieves its picture.
now what i want to do is that i want to display/hide its picture when i move mouse over/out of any employee id.

i need help in this regard.
JavaScript
page load()
{
 linkbutton.attributes.add("onmouseover","getEmpPic(someid)");
linkbutton.attributes.add("onmouseout","clrImage()");
}
void getEmpPic(empid)
{
// code to get image path
img.url='....'.jpg;
}
void clrImage()
{
img.visible=false;
}

want this functionality in asp.net C# web page

regards
Posted
Updated 11-Oct-15 21:54pm
v2

1 solution

I assume you have written the logic for getting the image for particular id on server-side. See the below code:
HTML
<a href="#" data-id="2" class="empName">CodeProject</a>

$(".empName").hover(function() {
    getEmpImg($(this).attr("data-id"));
});

$(".empName").mouseout(function() {
    clrImage();
});

Hope this helps :)


-KR
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900