Get the current value in bootstrap-select

I think the answer may be easier to understand like this: $(‘#empid’).on(‘click’,function() { alert($(this).val()); console.log($(this).val()); }); <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.10.0/jquery.min.js”></script> <select id=”empid” name=”empname” multiple=”multiple”> <option value=”0″>item0</option> <option value=”1″>item1</option> <option value=”2″>item2</option> <option value=”3″>item3</option> <option value=”4″>item4</option> </select> <br /> Hold CTRL / CMD for selecting multiple fields If you select “item1” and “item2” in the list, the output will … Read more

CSS Animated Checkmark

Since you are using a css file, you will need to convert the scss to css. Here’s a demo: .checkmark__circle { stroke-dasharray: 166; stroke-dashoffset: 166; stroke-width: 2; stroke-miterlimit: 10; stroke: #7ac142; fill: none; animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards; } .checkmark { width: 56px; height: 56px; border-radius: 50%; display: block; stroke-width: 2; stroke: … Read more

Load ajax when scroll reaches 80%

Provided your current check is firing when scrolled to the page’s bottom, you can try some basic arithmetics: if ($(window).scrollTop() >= ($(document).height() – $(window).height())*0.7){ //where 0.7 corresponds to 70% –^ Make sure to add a check to don’t fire multiple simultaneous Ajax requests, if you didn’t already. This is rather out of the scope of … Read more

Bootstrap $(‘#myModal’).modal(‘show’) is not working

Most common reason for such problems are 1.If you have defined the jquery library more than once. <script type=”text/javascript” src=”https://code.jquery.com/jquery-1.11.3.min.js”></script> <script src=”http://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js”></script> <div class=”modal fade” id=”myModal” aria-hidden=”true”> … … </div> <script src=”https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js”></script> The bootstrap library gets applied to the first jquery library but when you reload the jquery library, the original bootstrap load is lost(Modal … Read more

bind a jquery function to fancybox .close() event

*Update: * Please take a note of @mathoiland’s answer, “It looks like Fancybox 2 deprecated the onClosed callback. It now uses afterClose.” if you are using FancyBox 2.x Pass the onClosed option to the fancybox function. i.e: $(“<YOUR-SELECTOR>”).fancybox({ onClosed: function() { $(‘#sub_cont’).hide(250, function() { $(‘#IDsearchform input’).val(”); }); }) });