5

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.

ashurexm
  • 6,209
  • 3
  • 45
  • 69

4 Answers4

4

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:

Gabe Sumner
  • 4,978
  • 6
  • 33
  • 43
  • 1
    Hi Gabe, I've added the resource links and JQuery v 1.7.1 is loading, but somewhere along the line JQuery 1.6 is also being loaded. Where would this come from? – Jacques Mar 19 '12 at 09:57
1

Could you not try to use the Sitefinity jQuery instead?

To include the jQuery of theirs into a page you use:

<sitefinity:ResourceLinks id="resourcesLinks" runat="server">
<sitefinity:ResourceFile JavaScriptLibrary="JQuery"></sitefinity:ResourceFile>

jQuery UI should in theory be compatible with this as long as you also include it using a ResourceFile -

<sitefinity:ResourceFile Name="PathToJQueryUI/jqueryui.js" />

The order it is declared should be how it gets rendered...

Sean Molam
  • 618
  • 3
  • 8
  • I will try this- one question. Do I reference the Telerik jQuery with `$.`, `jQuery.` or something else? I guess I'll be able to find out shortly... – ashurexm Mar 31 '11 at 17:18
  • This answer applies to Sitefinity 3.x. If you're looking to add a jQuery reference in Sitefinity 4.x, see my answer. – Gabe Sumner Sep 02 '11 at 14:12
0

I think the jQuery files loaded by telerik are not compatible with your jQuery version.

I think you can try 2 things:

  1. Adjust your jQuery file according to their version.
  2. Telerik has some feature where you can supply the javascript files with EnableEmbeddedResource="false".

FYI: I used telerik way back, so i don't actually remember much, but above points might help you.

iMatoria
  • 1,450
  • 2
  • 19
  • 35
0
<sitefinity:ResourceLinks id="resourcesLinks" runat="server">

<sitefinity:ResourceFile JavaScriptLibrary="JQuery"></sitefinity:ResourceFile>

where to include these two lines to add JQuery to a Sitefinity page

Atta Ur Rahman
  • 131
  • 2
  • 4