In Controller
public ActionResult FancyBox()
{
return View();
}
In View
@{
ViewBag.Title = "FancyBox";
}
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<link href="~/Content/css/jquery.fancybox.css" rel="stylesheet" />
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script>
<script src="~/Content/js/jquery.fancybox.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$(".fancyTrigger").fancybox();
$(".fancyTrigger").trigger('click');
});
</script>
</head>
<body >
<a class="fancyTrigger" href="#TheFancybox"></a>
<div id="TheFancybox"><a href='http://www.google.com'><img src="~/Content/images/Chrysanthemum.jpg" /></a></div>
</body>
No comments:
Post a Comment