jQuery - plugins not working
There are several jQuery plugins that I need to use in my SF4.4 project but I can't seem to get any of them to work. For example, in my master page I'm trying to use a plugin that rounds the corners of divs. I've tried using the resource links control to add jquery and the link to the plugin but it doesn't work. I also have a cutom widget that I registered. In it I added a resource link to jQuery and a link to the plugin but it doesn't work either. When I make a call to the plugin I get an Object doesn't support property or method 'quicksand' error.
Can someone tell me what I'm doing wrong?
Thanks,
Jeff
Hmmm, are you calling your plugins like this
<
script
type
=
"text/javascript"
>
$("mydiv").quicksand();
</
script
>
<
script
type
=
"text/javascript"
>
$(document).ready(function()
$("mydiv").quicksand();
);
</
script
>
Here's a link to my original post.
http://www.sitefinity.com/devnet/forums/sitefinity/general-discussions/jquery-error-object-doesn-t-support-property-or-method-quicksand.aspx
I calling the plugin according to their documentation.
Thanks Steve
<script type=
"text/javascript"
>
$(document).ready(
function
()
$(
'.button'
).click(
function
(e)
$(
'.all'
).quicksand($(
'.warm li'
),
duration: 3000,
attribute:
'id'
,
easing:
'easeInOutQuad'
);
e.preventDefault();
);
);
</script>
Still not working. I have a hard coded link to the jquery lib in the master page that I thought might be causing the problem so I removed it. In the custom user control I have the following. On page load I get 'jQuery' is undefined. Then when I click the button I still get the original error.
<
sf:ResourceLinks
ID
=
"ResourceLinks1"
runat
=
"server"
>
<
sf:ResourceFile
JavaScriptLibrary
=
"JQuery"
/>
<
sf:ResourceFile
Name
=
"~/javascript/jquery.quicksand.1.2.js"
/>
<
sf:ResourceFile
Name
=
"~/javascript/jquery.easing.1.3.js"
/>
</
sf:ResourceLinks
>
Open Firefox->Firebug and in the Net tab...are they loading in the proper order? Like jQuery is coming first?
Using this syntax, I'm reminded of a bug where tilde (~/) items came before the others
So try this instead (see what happens)
<
sf:ResourceLinks
ID
=
"ResourceLinks1"
runat
=
"server"
>
<
sf:ResourceFile
JavaScriptLibrary
=
"JQuery"
/>
</
sf:ResourceLinks
>
<
sitefinity:JavaScriptEmbedControl
ID
=
"script1"
runat
=
"server"
ScriptEmbedPosition
=
"InPlace"
Url
=
"~/javascript/jquery.quicksand.1.2.js"
/>
<
sitefinity:JavaScriptEmbedControl
ID
=
"script2"
runat
=
"server"
ScriptEmbedPosition
=
"InPlace"
Url
=
"~/javascript/jquery.easing.1.3.js"
/>
I don't see jquery being loaded
I think it comes down in one of the ScriptResource.axd files (attached)
So try setting the ScriptEmbedPosition to "BeforeBodyEndTag" instead of "InPlace"
The JavaScriptEmbedControl did the trick. Thanks again Steve!! You're a lifesaver on this forum. I really appreciate your help.
Whew, great :)
I'd appreciate a "Marked as Answered" on the thread if possible :D
Hi All,
<%@ Register Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI" TagPrefix="sf" %>
<%@ Register TagPrefix="sitefinity" Assembly="Telerik.Sitefinity" Namespace="Telerik.Sitefinity.Web.UI.PublicControls"%>