I have created a static HTML page with anythingslider to show sliding portfolio works. In that static HTML page it works just fine. Now I am trying to convert this page to a WordPress template page. At first, I just copy contents of the static main container page (excluding header and footer) and it stops working. It gives me an error jQuery("#portfolioslide").data("AnythingSlider") is null
Where should I dig in to define the cause of the problem?
views:
27answers:
1
+1
A:
I'm not sure what you are trying to do, but .data() is for storing arbitrary data together with an element. Have you previously saved the data to the same element, with the same key, on the same page? If not, .data() is expected to return null. See documentation
Edit
In the source code for anything slider I found the following:
if ($(this).is('.anythingBase')) { return; } // prevent multiple initializations
In you HTML you have the following:
<ul id="portfolioslide" class="anythingBase" style="width: 4800px;">
Not good since anything slider thinks that you've already initialized portfolioslide. Remove class="anythingBase" and it should work
Onkelborg
2010-10-22 11:35:52
Probably not, it's just a reference to the very same object, at least as long you haven't done something very special like having two versions of jQuery loaded at the same time, bound to different variables
Onkelborg
2010-10-22 11:48:02
Can you describe what exactly you are trying to do, what you expect to happen, and what you have done?
Onkelborg
2010-10-22 11:48:47
The link doesn't work
Onkelborg
2010-10-22 11:54:19
Ok, I've found the problem. Updating my answer right now..
Onkelborg
2010-10-22 12:29:09
You are just a wizard, thanks so much, it works perfect now!
Sergey Basharov
2010-10-22 12:45:18
Good to hear :)
Onkelborg
2010-10-22 13:01:20