Accordion jQuery UI Options not working

0
Accordion jQuery UI Options not working 1
Anonymous
Nov 01, 2018 09:16 PM 1 Answers General
Member Since Jan 1970
Unsolved Solved Mark as Solved Mark as Unsolved
Subscribed Subscribe Not subscribe
Flag(0)

Hello,

 

in the past I was able to use something like that:

 

jQuery(document).ready(function(){

    var o = (new Date).getDay(); // Get the Daynumber

    var c = new Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag")[o]; // Set a name fr the number (4 = Donnerstag)

    "Montag" == c ? (jQuery("#accordions-272.accordions").accordion("option","active",0),

    jQuery("#accordions-273.accordions").accordion("option","active",0),

    jQuery("#accordions-274.accordions").accordion("option","active",0),

    jQuery("#accordions-275.accordions").accordion("option","active",0)):

    

    "Dienstag"==c?(jQuery("#accordions-272.accordions").accordion("option","active",1),

    jQuery("#accordions-273.accordions").accordion("option","active",1),

    jQuery("#accordions-274.accordions").accordion("option","active",1),

    jQuery("#accordions-275.accordions").accordion("option","active",1)):

    

    "Mittwoch"==c?(jQuery("#accordions-272.accordions").accordion("option","active",2),

    jQuery("#accordions-273.accordions").accordion("option","active",2),

    jQuery("#accordions-274.accordions").accordion("option","active",2),

    jQuery("#accordions-275.accordions").accordion("option","active",2)):

    

    "Donnerstag"==c?(jQuery("#accordions-272.accordions").accordion("option","active",3),

    jQuery("#accordions-273.accordions").accordion("option","active",3),

    jQuery("#accordions-274.accordions").accordion("option","active",3),

    jQuery("#accordions-275.accordions").accordion("option","active",3)):

    

    "Freitag"==c&&(jQuery("#accordions-272.accordions").accordion("option","active",4),

    jQuery("#accordions-273.accordions").accordion("option","active",4),

    jQuery("#accordions-274.accordions").accordion("option","active",4),

    jQuery("#accordions-275.accordions").accordion("option","active",4))

});

But after the last updates this solution does not work anymore for me. I get an error in the browser console.

(Uncaught Error: cannot call methods on accordion prior to initialization; attempted to call method 'option')

Did this plugin use the jquery ui accordion still? Or have anything changed in the code?

Thanks for your help.

Greetings

Magnus

2 Subscribers
Accordion jQuery UI Options not working 2
Submit Answer
Please login to submit answer.
1 Answers
Sort By:
Best Answer
0
Accordion jQuery UI Options not working 3
PickPlugins
Nov 01, 2018
Flag(0)

Welcome to our forum.

Can you please run your code under footer at the bottom, i hope this will still work with the latest version.

We just optimize js file loading not include on site header but under shortcode where loading accordion.

Let me know the update.

Regards

Sign in to Reply
Replying as Submit