Click here to Skip to main content
15,915,789 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Gridview contains an image,when on mouse hover the image should enlarge i.e Zoom
Posted

1 solution

You can try below mentioned JavaScript functions

C#
function zoom(img){
img.style.width = img.offsetWidth + 50 + "px";
}

function zoomOut(img){
 img.style.width = img.offsetWidth - 50 + "px";
}



XML
you need to attach these functions on every image inside grid on two events onmouseover and onmouseout. You can use GridView1 RowDataBound event for this.Below is sample.

<img src=badge1blue.gif style="height"  onmouseover="zoom(this)" onmouseout="zoomOut(this)"/>
 
Share this answer
 
Comments
bandamsravya 30-May-13 5:45am    
Thank u :)
Mahesh Bailwal 30-May-13 6:10am    
Can you mark it solved if it worked for you.
bandamsravya 12-Jun-13 3:59am    
isplay multiple images in gridview based on sqlstatement and zoom on the selectedimage using mouseover


Example: http://hyderabad.olx.in/collection-of-novels-for-sale-iid-518967022

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