Accordion problem in Firefox if you have a stylesheet link in body
-
This is really specific, as it only seems to affect the firefox browser.
I have an accordion on a page
If I navigate to another page and use the browser ‘back’ button to return to the page with the accordion, then the accordion no longer works properly.
What happens is the accordion won’t stay open when you click on it – it opens and then immediately closes again
I have debugged this and have found what causes it.
Another plugin that I have (lightweight social icons), puts a <link rel=”stylesheet” … > link into the body of the code (i.e. between the body tags rather than between the head tags).
Supposedly this shouldn’t be a problem as it is allowed by HTML5 but it is what is causing the problem.
I have verified that it is the stylesheet link that is causing the problem, by creating a copy of the page code and moving the stylesheet link into the header. All works OK then with the accordion.
I have no idea why the stylesheet link in the body causes a problem with the accordion, but I suspect it is something that Firefox is not doing correctly – i.e. probably a firefox bug.
If I inspect the accordion header (after the accordion has stopped working), it seems to have duplicate click handlers – so accordion-min.js is there twice for the ‘click’ event.
I am commenting here so it may help someone else with a similar problem as I’m not expecting there is anything you can do in your plugin to resolve the problem.
Thanks
- The topic ‘Accordion problem in Firefox if you have a stylesheet link in body’ is closed to new replies.