Home › Forums › JavaScript › Anythingslider not working with wordpress
- This topic is empty.
-
AuthorPosts
-
May 26, 2010 at 1:16 pm #29166
brubrant
MemberHi folks,
I’m trying to implement anythingslider in my wordpress site at: http://nauweb.com/dev/new/?page_id=70 but I can’t make it work.
I’m sure I have all the scripts properly loaded at my Head.
Can someone take a look and tell where is my mistake?
I know the CSS are all messed up, but, I’ll deal with it later.Thanks in advance!
Bruno.
May 26, 2010 at 1:32 pm #76529brubrant
MemberProblem solved!
Looks like there is a conflict between hybrid’s Dropdown.js and Anything slider.
So, if anyone using hybrid (http://themehybrid.com) wants to use anythingslider, you should disable de Dropdown Javascript.
July 21, 2011 at 3:15 pm #83763defsamm
MemberHi Bruno
I’m having trouble including AnythingSlider in WordPress. I keep getting $(‘class’).anthingSlider is not a function. I see you got it working on your site with no errors! How did you include the plugin? I’m baffled why it’s doing this because it’s in no conflict mode.
Cheers
Sam
July 22, 2011 at 12:54 am #83779Mottie
MemberHi @defsamm!
Are you using the latest AnythingSlider plugin for WordPress? If not, try it out.
Also, I don’t know if it’s just misspelled in the last post, but “anythingSlider” has a “y” in it :)
August 28, 2011 at 7:05 am #85857defsamm
MemberHi Mottie,
Thanks for the response and the link and the AnythingSlider support! I misspelled ‘anythingSlider’ in the post only. The wordpress plugin is great, but I need to use the FX plugin with it too and you can’t do that with the WP plugin. Just tried putting the normal jQuery plugin into my WP theme again, and I’m getting the same error. It’s strange – I have jQuery running in no conflict mode, and the only other jQuery plugins I have running are easing and validate.
I’m looking at maybe putting the slider and the fx options into a plugin/widget, and passing the code onto Jacob.
Thanks again
Sam
August 28, 2011 at 8:19 am #85858Mottie
MemberHey Sam!
When you use no conflict mode, instead of using the “$”, use “jQuery” instead, because the “$” gets reverted to it’s previous state. So do this:
jQuery('class').anythingSlider();
Jacob has been working on integrating the FX extension with the WP plugin so we’ll just have to be patient a bit longer ;)
In the mean time, have you checked out the FX builder bookmarklet I made? It’s still in beta and I’m sure there are still some bugs in it but it should make adding FX a lot easier.
August 29, 2011 at 5:11 am #85905defsamm
MemberCheers Mottie,
Gave that a try but still no joy :(
The way I’m calling jQuery in no conflict mode is like this:
jQuery(document).ready(function($) {
function formatText(index, panel){return “”};
$(‘ul.hp_slider’).anythingSlider({
width: 940,
height: 350,
buildArrows: false,
buildNavigation: true,
delay: 7000,
animationTime: 900,
easing: “easeInOutExpo”,
hashTags: false,
navigationFormatter: formatText})
.anythingSliderFx({
‘.sldr_txt_cont’ : [ ‘caption-Right’, ‘640px’ ]
});});
I gave it a try without any $ signs but still got the same error telling me that it isn’t a function. I’ll keep hacking about and trying different things :)
Your FX builder bookmarklet looks really cool. I’ll be having a play with that!
Thanks again
Sam
August 29, 2011 at 8:54 am #85911Mottie
MemberAnother problem I’ve run into is that jQuery gets loaded twice on the page. Once above the script tag that loads the plugin and once again below it. What happens is that the plugin code attaches itself to the first copy, but by the time the document ready event fires, the second copy of jQuery has taken over. The second copy doesn’t have the slider plugin attached to it so it throws an error.
So essentially, double check to make sure that there aren’t two copies of jQuery being loaded on the page.
August 29, 2011 at 9:23 am #85912defsamm
MemberCheers Mottie
Found what the problem was about a minute ago! It was to do with the way I was calling the script. After going through my code with a fine tooth comb, I’d omitted a / in the file path… This explains the error message.
Feel like a prize fool now. Thank you so much for all the help and really sorry that it was such a silly little thing. If I manage to get the FX plugin into a widget, I’ll send it over to see if it helps Jacob.
Thanks again
Sam
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.