I want to use the UIKit toggle the table’s by javascript
work find, but click toggle item will close itself
I don’t want the toggle target close itself when it’s clicked, only toggle link or button control the toggle open and close
Codpen Sample
<!doctype html>
<html>
<body>
<div id="Test_Table_Div">
<table id="Test_Table">
<tr class="A">
<td>
<a>Link_Click_Toggle</a>
</td>
</tr>
<tr class="B" hidden>
<td>
<table>
<tr><td>123</td></tr>
<tr><td>ABC</td></tr>
</table>
</td>
</tr>
</table>
</div>
</body>
<script src="https://code.jquery.com/jquery-3.7.1.js"></script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/uikit.min.js"></script>
</html>
$("#Test_Table_Div").on( "click", "#Test_Table tr.A a", function() {
UIkit.toggle("#Test_Table_Div #Test_Table tr.B", { animation: "uk-animation-fade" }).toggle() ;
}) ;
New contributor
jimmy123j is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.