These days I went through difficult times, I tried to implement a jQuery plugin called elevate zoom but couldn't succeed thought this might be the problem with jQuery plugin and switched to implement Cloud Zoom but had no luck yet. I placed all the scripts needed by this plugin into my view and also the CSS as you can see my view code:
@{
ViewBag.Title = "Zoom";
Layout = "~/Views/Shared/_Layout.cshtml";
}
<title>Cloud Zoom</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Include jQuery. -->
<script type="text/javascript" src="~/Scripts/jquery-1.10.2.min.js"></script>
<!-- Include Cloud Zoom CSS. -->
<link rel="stylesheet" type="text/css" href="~/Content/cloudzoom.css" />
<!-- Include Cloud Zoom script. -->
<script type="text/javascript" src="~/Scripts/cloudzoom.js"></script>
<!-- Call quick start function. -->
<script type="text/javascript">
$(function(){CloudZoom.quickStart();})
</script>
<!-- Setup the zoomImage property to point to the big image. -->
<img class="cloudzoom" src="~/images/small/image1.jpg"
data-cloudzoom="zoomImage: '~/images/large/image1.jpg'" />
Layout code:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>@ViewBag.Title - My ASP.NET Application</title>
@Styles.Render("~/Content/css")
@Scripts.Render("~/bundles/modernizr")
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
@Html.ActionLink("Application name", "Index", "Home", new { area = "" }, new { @class = "navbar-brand" })
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li>@Html.ActionLink("Home", "Index", "Home")</li>
<li>@Html.ActionLink("About", "About", "Home")</li>
<li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>
@Html.Partial("_LoginPartial")
</div>
</div>
</div>
<div class="container body-content">
@RenderBody()
<hr />
<footer>
<p>© @DateTime.Now.Year - My ASP.NET Application</p>
</footer>
</div>
@Scripts.Render("~/bundles/bootstrap")
@RenderSection("scripts", required: false)
</body>
</html>
Final Generated HTML:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Zoom - My ASP.NET Application</title>
<link href="/Content/bootstrap.css" rel="stylesheet"/>
<link href="/Content/site.css" rel="stylesheet"/>
</head>
<body>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="container">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="/">Application name</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="/">Home</a></li>
<li><a href="/Home/About">About</a></li>
<li><a href="/Home/Contact">Contact</a></li>
</ul>
<ul class="nav navbar-nav navbar-right">
<li><a href="/Account/Register" id="registerLink">Register</a></li>
<li><a href="/Account/Login" id="loginLink">Log in</a></li>
</ul>
</div>
</div>
</div>
<div class="container body-content">
<title>Cloud Zoom</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- Include jQuery. -->
<script type="text/javascript" src="/Scripts/jquery-1.10.2.min.js"></script>
<!-- Include Cloud Zoom CSS. -->
<link rel="stylesheet" type="text/css" href="/Content/cloudzoom.css" />
<!-- Include Cloud Zoom script. -->
<script type="text/javascript" src="/Scripts/cloudzoom.js"></script>
<!-- Call quick start function. -->
<script type="text/javascript">
$(function(){CloudZoom.quickStart();})
</script>
<!-- Setup the zoomImage property to point to the big image. -->
<img class="cloudzoom" src="/images/small/image1.jpg"
data-cloudzoom="zoomImage: '~/images/large/image1.jpg'" />
<hr />
<footer>
<p>© 2016 - My ASP.NET Application</p>
</footer>
</div>
<script src="/Scripts/bootstrap.js"></script>
<script src="/Scripts/respond.js"></script>
<!-- Visual Studio Browser Link -->
<script type="application/json" id="__browserLink_initializationData">
{"appName":"Firefox","requestId":"c6cb955b8169466e9a82c8082a334502"}
</script>
<script type="text/javascript" src="http://localhost:6214/1d36907a16cf4beea1f3582a362b6719/browserLink" async="async"></script>
<!-- End Browser Link -->
</body>
</html>
$(function(){ CloudZoom.quickStart(); })?