jQuery(“#portfolioslide”).data(“AnythingSlider”) is null

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?

Related posts

Leave a Reply

1 comment

  1. 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