I have a div container and a button that when clicked, simply adds a class to an element in my mark-up allowing it to expand into a full screen div.
Before: (start of mark-up)
<section class="isi" data-trigger="toggle" data-trigger-class="isi--show-isi">
After class is attached:
<section class="isi isi--show-isi" data-trigger="toggle" data-trigger-class="isi--show-isi">
The Problem:
The problem is, I am simply trying to create a new instance of this anchor link to trigger this same attach class to show this div the same way with a different link.
attempt:
$('a.isilnk').on('click', function(){
$('.isi').addClass('isi--show-isi');
});
I have tried writing click function the other way, I have tried toggleClass and I have tried trigger click. But it seems to ONLY attach the class for a brief second and then quickly unattach during this instance any thoughts?