Hi,
Ive been trying to implement a colorbox popup for the past 2 days and Im at stuck at pretty much the last step.
I have an anchor that, when clicked, should load in a colorbox into a container I have set up in _Layout.cshtml
Code:<a href="@Url.Action("RenderColorbox", "ContactPartial", new { path = "_ContactPartial" })" class="colorboxLink"><span>ContactUs</span></a>
Here is the js ajax request to load the partialview (_ContactPartial.cshtml) into its container in the _Layout.cshtml
Code:$('.colorboxLink').click(function () { $('.colorbox_container').load(this.href, function () { var colorboxOptions = { inline: true, scrolling: false, opacity: ".9", fixed: true } $('#contactColorbox').colorbox(colorboxOptions); }); return false; //return false for click event otherwise partial view will load on seperate page });
Here is the partial view itself (_ContactPartial.cshtml)
The partial view loads into its container correctly but is does not do so as a colorbox but rather as an un-animated popup modal. Can someone help me get the view to load as a colorbox.Code:@model DiscreteFX_MVC4.Models.ContactForm <div id="contactColorbox"> @using (Html.BeginForm("Index", "ContactPartial", FormMethod.Post)) { ...... } </div>
Thanks




Reply With Quote