Click here to Skip to main content
14,735,324 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I want to resize images dynamicalyy that images which are placed in table in my table all rows containing images only it genarate dyanamicalyy

1 solution

You can solve this easily with javascript.
What is your problem exactly?
kingsa 16-May-12 7:11am
<html xmlns="">
<head runat="server">
<style type="text/css">
p {

img {
<script type="text/javascript" language="ecmascript">
function SBImage(obj) {
document.getElementById("previewDiv").innerHTML = "<img src='" + obj.src + "'+'width=500 height=500' >";
function SDImage(obj) {
document.getElementById("previewDiv").innerHTML = "";
// function move_Area(event) {
// event = event || window.event;
// = event.clientX + document.body.scrollLeft + 10;
// = event.clientY + document.body.scrollTop + 10;
// }
// // document.onmousemove = move_Area;

<form id="form1" runat="server">
<asp:Image ID="Image1" runat="server" Width="100px" Height="100px"
<asp:Image ID="Image2" runat="server" Width="100px" Height="100px"
<div id="previewDiv" style="position: absolute; z-index:2">
kingsa 16-May-12 7:12am
I Had done dis but its limted images i want dynamicalyy which i having in dynamic genarated table
Zoltán Zörgő 16-May-12 7:34am
Use a specific class name, that you add to your IMG tag when you generate it. Use JQuery to add on page loaded your current onmouseover and onmouseout event handlers to the images with that specific class name.

$(function() {
$("IMG.hoverimgclass").mouseover(function() {
$("#previewDiv").html("<img src='" + $(this).attr("src") + "'+'width=500 height=500' >");

Well, the inner part can be made more jquery, but the idea is this.
I suggest dont change the innerhtml of the div, place an image, and change its src and visibility.
Zoltán Zörgő 17-May-12 2:47am
Update: I am not sure what you mean by "dynamic": is it serverside generated or client side. With serverside you can use what I posed. If your images are generated on client side with JS, you have to add the event handlers during or after element generation, since on pageload they will exist yet.

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