Change Caption Accordion with JS
-
- Posts: 29
- Joined: Fri May 25, 2018
Hi,
it is possible, to change the Caption from an Accordion by Code (Displayform)?
Manuell i set the Title (or Caption?) to "old Caption" and the css-class named "cssAcc" and tried this code:
It displays the new Name, but the Accordion losts his functionality.
thx in advanced.
it is possible, to change the Caption from an Accordion by Code (Displayform)?
Manuell i set the Title (or Caption?) to "old Caption" and the css-class named "cssAcc" and tried this code:
Code: Select all
$(".cssAcc").html($(".cssAcc").html().replace(/old Caption/,"new Caption"));
thx in advanced.
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear slashmaster,
Please, use the following code, it should work:
Please, use the following code, it should work:
Code: Select all
$('.ui-accordion h3:contains("old Caption")').text('new Caption');
Cheers
-
- Posts: 29
- Joined: Fri May 25, 2018
Dear Nikita,
thank u for ur fast Response. The good News: it works - i can expand or Close the Accordion. The Bad News: the Arrow (wich is showing expand/Close) is missing... Any ideas?
ty
thank u for ur fast Response. The good News: it works - i can expand or Close the Accordion. The Bad News: the Arrow (wich is showing expand/Close) is missing... Any ideas?
ty
- Nikita Kurguzov
- Posts: 889
- Joined: Mon Jul 03, 2017
Dear slashmaster,
Here, try this instead then:
Here, try this instead then:
Code: Select all
var newText = $('.ui-accordion h3:contains("old Caption")').html().replace("old Caption", "New Caption");
$('.ui-accordion h3:contains("old Caption")').html(newText);
Cheers
-
- Posts: 29
- Joined: Fri May 25, 2018
Good Morning Mr. Nikita
incredible, it works fantastic.
Thank u very very much!
incredible, it works fantastic.
Thank u very very much!
-
- Information
-
Who is online
Users browsing this forum: No registered users and 9 guests