Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Trouble with jQuery/jQuery UI and Sitefinity 4.0

I am trying to use jQuery.hide("#whatever .class").hide("slide", { direction: "right" }, 750); to 'slide' previously hidden divs in and out (think scrolling portals)... In just a basic HTML template it works fine. When I turn this into a Sitefinity master template it seems to be clashing with a built in version of jQuery and using $.noConflict(); does not seem to be helping. The error I'm getting is:

Error: c.easing[this.options.specialEasing && this.options.specialEasing[this.prop] || a] is not a function
Source File: http://localhost/Sf4/ScriptResource.axd?d=OA8H8dIKI9jNRfyUWi_J-1dnW6KOX2OUR5SdpCRyXm_z1b9rEU86tS8njjEZ9-Nr0A8c_jz50CI8odnGSlRAImvVnFIjTj-xE7VHrDCn7icWqBV98QgezjOTu21wu6_-0&t=ffffffff82d3fa2f
Line: 556

every time it tries to slide. It appears that the auto generated Telerik code is overriding the jQuery UI JS file I've imported. I've even tried putting my JS file includes in the HTML <body> tag to make sure they come last- still no luck.

like image 316
ashurexm Avatar asked Mar 15 '11 20:03

ashurexm


1 Answers

I agree with others that utilizing Sitefinity's built-in JQuery library is preferred.

--

Regarding how to reference that built-in jQuery library, this is how it's done with Sitefinity 4.x:

<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<sf:ResourceLinks ID="resourcesLinks" runat="server">
    <sf:ResourceFile JavaScript Library="JQuery" />
</sf:ResourceLinks>

The official documentation on this topic can be found below:

  • How to use jQuery in Sitefinity 3.x
  • How to use jQuery in Sitefinity 4.x
like image 174
Gabe Sumner Avatar answered Oct 03 '22 21:10

Gabe Sumner