Hi Albana_12
your script gets the last character of the
eventId, so i'm presuming in the original
eventId thats passed to it, there is a string before the number? like so:
foo12
for example.
if that's correct, then you can simply run through the characters until they are no longer numbers:
Code:
function wysiwyg_tools_plus_theme_toggleAccordion… {
var temp = "";
while(!isNaN(eventId.substring(eventId.length-(temp.length+1), eventId.length)))
{
temp = eventId.substring(eventId.length-(temp.length+1), eventId.length);
}
$('#acc-' + temp).toggle('fast');
}