JQueryFancyBox not working in Custom Widget
Hi There,
I have creating a simple user control in the website where I have an image as a link and when I click on the image link it should open a Fancybox with the image, but instead it is not working and giving error in the Fancy box jquery.
I think the JavaScriptLibrary="JQuery" is not loading at all. Let me explain:
CODE:
<%@ Control Language="C#" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls.BrowseAndEdit" TagPrefix="sf"%>
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<sf:ResourceLinks ID="ResourceLinks1" runat="server">
<sf:ResourceFile JavaScriptLibrary="JQuery" />
<sf:ResourceFile JavaScriptLibrary="JQueryFancyBox" />
</sf:ResourceLinks>
<div id="SingleProd">
<a href="localhost:60876/.../high-rise-tve-350-popup" rel="PAVfancybox" title ="TVE_350" >
<img src="temspec.in-development.ca/.../tve_350">
</a>
</div>
<script language="javascript" type="text/javascript">
$(document).ready(function ()
$("a[rel*='PAVfancybox']").fancybox();
);
</script>
Now, Whenever I hit the link it gives me the following Error:
Unhandled exception at line 26, column 185 in localhost:60876/Telerik.Web.UI.WebResource.axd
0x800a01b6 - JavaScript runtime error: Object doesn't support property or method 'onCleanup'
NOTE: Just to let you know the user control is an "Embedded Resource."
Please guide me here how to resolve this issue.
Regards,
Nimit
Hello,
Can anybody please help me here ?
Hi there,
Can please let me know if anybody on Sitefinity's team can help me here or would it be easier if I should open a ticket ?
Please reply ASAP.
regards
Hello Nimit,
You should reference the Fancybox css and it should work fine:
<
sf:ResourceLinks
ID
=
"ResourceLinks1"
runat
=
"server"
>
<
sf:ResourceFile
JavaScriptLibrary
=
"JQuery"
/>
<
sf:ResourceFile
JavaScriptLibrary
=
"JQueryFancyBox"
/>
<
sf:ResourceFile
Name
=
"Telerik.Sitefinity.Resources.Themes.Basic.Styles.fancybox.css"
Static
=
"true"
/>
</
sf:ResourceLinks
>