I've set up a div container with a button that, upon clicking, adds a class to an element in my markup causing it to expand and take over the entire screen.
Markup before:
<section class="isi" data-trigger="toggle" data-trigger-class="isi--show-isi">
After adding the class:
<section class="isi isi--show-isi" data-trigger="toggle" data-trigger-class="isi--show-isi">
The Issue:
The problem arises when attempting to create a new anchor link instance to trigger this same class attachment for displaying the div in a similar manner but through a different link.
My attempt:
$('a.isilnk').on('click', function(){
$('.isi').addClass('isi--show-isi');
});
I've experimented with different methods such as toggling classes and triggering clicks, yet the class appears to be attached only momentarily before quickly detaching. Any insights on how to overcome this?