WBCE CMS Forum

WBCE CMS – Way Better Content Editing.

Du bist nicht angemeldet.

#1 21.02.2020 12:27:22

meetje
Mitglied

[Gelöst] Accordion module - link zum text schliessen

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

#2 21.02.2020 16:00:26

tomno399
Gast

Re: [Gelöst] Accordion module - link zum text schliessen

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

#3 21.02.2020 20:33:25

meetje
Mitglied

Re: [Gelöst] Accordion module - link zum text schliessen

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

#4 21.02.2020 22:08:21

bernd
Developer

Re: [Gelöst] Accordion module - link zum text schliessen

Just to get you right. You want to achieve something like this?
Auswahl_109.png


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Offline

#5 21.02.2020 22:18:20

meetje
Mitglied

Re: [Gelöst] Accordion module - link zum text schliessen

Yes  Bernd, that's right!

Hans

Offline

#6 21.02.2020 22:28:39

bernd
Developer

Re: [Gelöst] Accordion module - link zum text schliessen

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

#7 21.02.2020 22:58:17

meetje
Mitglied

Re: [Gelöst] Accordion module - link zum text schliessen

You're great, thank you so much!!

Hans

Offline

#8 21.02.2020 23:28:52

bernd
Developer

Re: [Gelöst] Accordion module - link zum text schliessen

You're welcome ;-)


... nein in Europa verwenden wir beim Programmieren nicht € statt $ ...

Offline

Fußzeile des Forums

up