+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / JQueryFancyBox not working in Custom Widget

JQueryFancyBox not working in Custom Widget

4 posts, 0 answered
  1. NimitV
    NimitV avatar
    68 posts
    Registered:
    06 Apr 2010
    25 Apr 2014
    Link to this post

    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="http://localhost:60876/images/default-source/high-rise-products/high-rise-tve-350-popup" rel="PAVfancybox" title ="TVE_350" >
           <img src="http://temspec.in-development.ca/images/default-source/high-rise-products/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 http://localhost:60876/Telerik.Web.UI.WebResource.axd?_TSM_HiddenField_=ctl01_TSM&compress=0&_TSM_CombinedScripts_=;;Telerik.Sitefinity.Resources:en:fc2ebef4-f9ad-4295-94c5-72ca5c30cdcc:75f24b3a;Telerik.Web.UI,+Version=2013.3.1114.40,+Culture=neutral,+PublicKeyToken=121fae78165ba3d4:en:19ed0f67-b7c5-4234-85ed-71945df8ae77:16e4e7cd:f7645509:24ee1bba:e330518b:2003d0b8:88144a7a:1e771326:c8618e41

    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

     

  2. NimitV
    NimitV avatar
    68 posts
    Registered:
    06 Apr 2010
    29 Apr 2014
    Link to this post

    Hello,

    Can anybody please help me here ?

  3. NimitV
    NimitV avatar
    68 posts
    Registered:
    06 Apr 2010
    12 May 2014
    Link to this post

    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

  4. Nikola Zagorchev
    Nikola Zagorchev avatar
    424 posts
    Registered:
    24 Nov 2016
    13 May 2014
    Link to this post
    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>


    Regards,
    Nikola Zagorchev
    Telerik
     
    Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Sitefinity CMS Ideas&Feedback Portal and vote to affect the priority of the items
     
4 posts, 0 answered