WBCE CMS – Way Better Content Editing.
Du bist nicht angemeldet.
Deutsch:
Re: Accordion module - link zum text schließen am Unterseite des Fensters
Ich benutze das Accordeonmodul auf meiner Website recht häufig, besonders für längere Texte. Besonders in diesen Fällen wäre es praktisch, wenn es eine Möglichkeit gäbe, den Text unten zu schließen. Ich habe ein paar Dinge ausprobiert, aber dann hat sich meine Unkenntnis mit der Programmierung gerächt.
Kann mir jemand bei einem Code-Vorschlag helfen?
English:
I use the accordion module quite often on my website, especially for longer texts. Especially in those cases it would be handy if there was a possibility to close the text at the bottom. I've tried a few things but then my unfamiliarity with programming is avenged.
Can someone help me with a code proposal?
Danke im Voraus! Thanks in advance
Hans
Beitrag geändert von florian (25.03.2020 10:27:20)
Offline
Vielleicht solltest du einen Fenster-Befehl benutzen und nicht das Modul verbiegen wollen? Wenn du ein Template ohne "Aufwärts-Button" benutzt, schau dir bitte mal die Links an.
Perhaps it is better to use a window command than to bend the module? If you use a template without an "up button", please take a look at the links:
https://api.jquery.com/scrollTop/#scrollTop
https://www.w3schools.com/jsref/met_win_scrollto.asp
https://www.jqueryscript.net/other/jQue … ageup.html
Tom
Thank you.
I will give it a try, although I think that this only scrolls up and doesn't close the 'window' (as the - sign on top of the accordion does).
I'll let you know if it did the trick.
Greetz. Hans
Offline
Just to get you right. You want to achieve something like this?
... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...
Offline
Yes Bernd, that's right!
Hans
Offline
O.k.
replace the /modules/accordion/view.php with the attached one.
The changes in detail:
Line 56
echo '<div class="accordion-content">'.$content.'<p><a href="#" class="bottom-close">close</a></p></div>';
Implants the "close" link in every accordion-content div
Line 65ff
$(".bottom-close").click(function() {
$(".accordion-content").slideUp(150);
$(".accordion-title").removeClass("open");
});
Handles the click function for this links.
... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...
Offline
You're great, thank you so much!!
Hans
Offline
You're welcome ;-)
... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...
Offline