inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Oct 23, 2017 12:20:57 GMT -8
sehnsucht.boards.net/For reference the accordion is what I have replacing the infocenter at the bottom left. When toggling any of the states anything with the class 'title' and 'subtitle' are equally disappearing. Any help on how to fix this please would be greatly welcomed
|
|
inherit
Official Code Helper
65613
0
1
Apr 15, 2024 17:01:41 GMT -8
Chris
"'Oops' is the sound we make when we improve"
8,870
December 2005
horace
|
Post by Chris on Oct 23, 2017 14:14:54 GMT -8
according to this code: (function ($) { 'use strict'; $('.item').on("click", function () { $(this).next().slideToggle(100); $('p').not($(this).next()).slideUp('fast'); });
It would hide every <p> element on the page except the one following the clicked item. I'm not familiar with the code but I would think it needs to have its scope limited to the <p> elements within the accordion area only, not all the <p> elements on the entire page. You could try setting a context to limit it to finding just the <p> elements in the accordion area like so: $('p', $('.accordion')).not($(this).next()).slideUp('fast');
or if you prefer $('.accordion').find('p').not($(this).next()).slideUp('fast');
Edit: Note: If you plan on having multiple accordion areas on the same page bearing the same className then it might instead be beneficial to use a closure variable to keep track of the scope. Also since the .item class is used by the Proboards structure it might be wise to use a more specific selector such as ' .accordion .item' to avoid affecting the other items unless that is your intent.
|
|
inherit
Peabrained Codebreaker
107114
0
Mar 11, 2020 7:47:27 GMT -8
Boy_Wonder
6,249
July 2007
natzy24
|
Post by Boy_Wonder on Oct 23, 2017 21:17:16 GMT -8
Thank you - I've done some tweaking to the coding to try and remove any further clashes
|
|