Friday, 13 March 2015

jQuery Magnifying Glass Zoom Plugin Effect Css in Asp.net MVC

3/13/2015 - By Pranav Singh 0

This article will show you how you can create jQuery Magnifying Glass Zoom Plugin Effect Css in Asp.net MVC.


So for this article first we will create a new mvc application. Here is the controller code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;

namespace MvcApplication1.Controllers
{
    public class HomeController : Controller
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            ViewBag.SmallImage = "../../Images/Tulips_small.jpg";
            ViewBag.BigImage = "../../Images/Tulips.jpg";
            return View();
        }
    }
}

In above code I have stored image path in view bag. Add the below code into you view after creating it.
@{
    ViewBag.Title = "jQuery Magnifying Glass Zoom Plugin Effect Css in Asp.net Mvc";
}
<link href="../../css/magnificent.css" rel="stylesheet" type="text/css" />
<script src="//ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script src="../../js/magnificent.js" type="text/javascript"></script>
<script>
    $(document).ready(function () {
        $('img').magnify();
    });
</script>
<img src="@ViewBag.SmallImage" alt="" data-magnify-src="@ViewBag.BigImage">

In above code I have used two type of images one small and other is for large image which will be shown in magnification glass.

Now we have done. Run the application to check the output.


Now put the mouse cursor for viewing magnification effect.

About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top