Wednesday 10 April 2013

ASP.net : Image zoom using Jquery and Elevate plug-in | Neha Sharma



Introduction:

This article is about to explain how to create Image zoom in ASP.Net using Jquery and Elevate plug-in.

Requirement:

1.       Download Elevate plug-in

Code :

Write the below code in to your page :

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Image zoom</title>
    <script src='http://code.jquery.com/jquery-1.9.1.min.js'></script>
       <script src='jquery.elevateZoom-2.5.3.min.js'></script></head>
    <%--<script src='jquery.fancybox.js'></script>--%>
 
<body>
<div>
    <asp:Image ID="Image1" runat="server" ImageUrl="small/image_1.jpg" data-zoom-image="large/image_1.jpg"/>
 </div>
<script>
    $("# Image1").elevateZoom({ gallery: 'gallery_01', cursor: 'pointer', galleryActiveClass: 'active' });

    //pass the images to Fancybox
    $("# Image1").bind("click", function (e) {
        var ez = $('# Image1).data('elevateZoom');
        return false;
    });
</script>
</body>
</html>

Save all and run view the page in browser it ll work perfectly.

Thanks

Neha Sharma

9 comments:

  1. Good one.. Try to put more description's or explanations about the function's etc.. you are improving your articles.. keep posting. And also, I liked your web site theme, very different, sound and loud..

    Suthish Nair
    http://www.ssnair.net

    ReplyDelete
  2. Thanks a lot to place your nice and kind words here it ll be my pleasure to make some changes or modify my way of article writing...

    Thanks.

    ReplyDelete
  3. Hi azadeh,

    You need to write this code in aspx(source code)not in c# or not in vb.it ll work for both.

    ReplyDelete
  4. How to dynamically give the data-zoom-image in a datalist? This will really help if clarified.

    ReplyDelete
  5. Its not working when used in content page can u please explain this using content page

    ReplyDelete
  6. How to dynamically give the data-zoom-image please reply me

    ReplyDelete
  7. How to dynamically give the data-zoom-image ?
    i think it is not possible , but if any one have good knowledge then just reply me

    ReplyDelete
  8. its not working with content please reply

    ReplyDelete

Which Game Engine you should choose | Neha Sharma

Unity3D and Unreal Engine are only 2 Game engine which executes an indispensable position in Game Industry. The choice of the engine must ...