Home > ASP.Net, Javascript > JavaScript to Maximize image

JavaScript to Maximize image


Hi

try this example:

<html xmlns="<a href="http://www.w3.org/1999/xhtml">http://www.w3.org/1999/xhtml</a>" >
<head runat="server">
    <title>Untitled Page</title>
    <style type="text/css">
        .image {width:187px; height:224px; border: 1px solid #000000}
    </style>
    <script type="text/javascript">
        var restored = true        
        function MaximizeRestore()
        {
            if (restored == true)
            {  
                document.getElementById('<%= Image2.ClientID %>').style.width="200";
                document.getElementById('<%= Image2.ClientID %>').style.height="200";               
                restored = false;
            }
            else
            {
                document.getElementById('<%= Image2.ClientID %>').style.width="119";
                document.getElementById('<%= Image2.ClientID %>').style.height="142";               
                restored = true;
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div>
    <img id="Image2" src="images/image.jpg" alt="testimage" class="image" onclick="MaximizeRestore()" />   
    </div>
    </form>
</body>
</html>

Good Luck

Advertisements
Categories: ASP.Net, Javascript
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: