skip to Main Content

Bootstrap 5.3 events not working in jQuery .on event

This is such an odd issue. I've never had any issues like this before... Here is my dropdown... $('#mydropdown').on('show.bs.dropdown', function() { console.log('hit 1'); }); $(document).on('show.bs.dropdown', '#mydropdown', function() { console.log('hit 2'); }); <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.7.1/jquery.min.js"></script><script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js"></script> <link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet"/> <div class="dropdown" id="mydropdown">…

VIEW QUESTION

Css – Adjust navbar height to be smaller

I was using the first header from bootstrap’s examples: https://getbootstrap.com/docs/5.3/examples/headers/# And I have this: <div class="container fixed-top bg-white"> <header class="d-flex flex-wrap justify-content-center py-3 mb-4"> <a href="/" class="d-flex align-items-center mb-3 mb-md-0 me-md-auto link-body-emphasis text-decoration-none"> <svg class="bi me-2" width="40" height="32"><use xlink:href="#bootstrap"/></svg> <span…

VIEW QUESTION

Javascript – Convert a input checkbox to 2 separate buttons

The input checkbox toggles between light/dark mode. However, I want it as 2 separate buttons. How do I go about this? Demo: https://jsfiddle.net/ot1ecnxz/1 HTML: <input type="checkbox" role="switch" id="flexSwitchCheckChecked" checked onclick="myFunction()" /> <hr /> <button type="button" data-bs-theme-value="light"> Light </button> <button type="button"…

VIEW QUESTION

Css – In a Bootstrap 5 toast how can I align the Close button to the right?

I define a Bootstrap 5 toast like this: <div id="liveToast" class="toast hide" role="alert" aria-live="assertive" aria-atomic="true"> <div class="toast-header"> <strong class="me-auto">Help</strong> <button type="button" class="end-0 close" data-dismiss="toast"> <span>&times;</span> </button> </div> ... </div> hoping the end-0 class would align the Close button character &times;…

VIEW QUESTION
Back To Top
Search