Jump to content
crusin316

acoordion not working

Recommended Posts

hello everyone,

suddenly today accordion stopped working on our website. whenever u click on any other sections it doesnt seem to be opening up, any help would be really useful

XXXXXXXXXXXXXXXXXXXXXXXXXXXXX

we are not sure how and why it stopped working.

Edited by horst
removed suspicious link

Share this post


Link to post
Share on other sites

I removed the link. Refer to this thread and posts on how to use our support forums:

Question that are not related to ProcessWire can be asked in the DEV forum, not in PW support forums. 

Share this post


Link to post
Share on other sites

hello,

but our website is build on processwire and something stopped working there hence published in support forum for help from users on how we can fix it.

Share this post


Link to post
Share on other sites

Quoting questions from the other thread:

  • What ProcessWire version are you using?
  • Did you change something in the code just before the accordion stopped working?

And some other questions:

  • Who is maintaining that site?
  • Wo built that site?
  • Are you experienced in web development?
     
  • Like 1

Share this post


Link to post
Share on other sites

answering your queries.

  • What ProcessWire version are you using? - ProcessWire 3.0.42 
  • Did you change something in the code just before the accordion stopped working? - no we havent updated the code it just stopped working.

And some other questions:

  • Who is maintaining that site? - it is maintained by us on our server.
  • Wo built that site? - it was build by a agency couple of years ago.
  • Are you experienced in web development? - not much but i can do basic stuff

Share this post


Link to post
Share on other sites

Ok, that's a solid starting point.

I found your other post in within the link to your site here.

There is one JavaScript file that might be the problem here - but is just a guess for now.

It's located here: yoursite.com/site/templates/js/scripts.js

In this script is a part connected to the accordion and its function starting in line 201.

//////////////// Accordions
/* mr = (function (mr, $, window, document){
    "use strict";
    
    var documentReady = function($){
        $('.accordion__title').on('click', function(){
            var accordion = $(this).closest('.accordion');
            var li = $(this).closest('li');
            if(li.hasClass('active')){
                li.removeClass('active');      
            }else{
                if(accordion.hasClass('accordion--oneopen')){
                    var wasActive = accordion.find('li.active');
                    wasActive.removeClass('active');
                    li.addClass('active');
                }else{
                    li.addClass('active');
                }
            }
        });

        $('.accordion').each(function(){
            var accordion = $(this);
            var minHeight = accordion.outerHeight(true);
            accordion.css('min-height',minHeight);
        });
    };

    mr.accordions = {
        documentReady : documentReady        
    };

    mr.components.documentReady.push(documentReady);
    return mr;

}(mr, jQuery, window, document)); */

As you might already see here the functionality is commented out and therefore disabled (see /* in line 202 and */ in line 236).

That would be my starting point for further actions.

I wouldn't suggest testing it within the real live website as other things could go wrong. Do you have a testing or development version of your website? Or maybe even better still contact to that agency?

  • Like 1

Share this post


Link to post
Share on other sites

Next step here would be to find out WHY this was disabled/commented out.

The same for the slider that stopped working a while back.

Both weren't something that ProcessWire changes on its own.

So it either didn't work for a long time or someone is still changing things on your site. Just a thought!

  • Like 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...