How to programmatically select selectables with jQuery UI?

Here is a variation of Alex R’s code working with multiple elements http://jsfiddle.net/XYJEN/1/ function SelectSelectableElements (selectableContainer, elementsToSelect) { // add unselecting class to all elements in the styleboard canvas except the ones to select $(“.ui-selected”, selectableContainer).not(elementsToSelect).removeClass(“ui-selected”).addClass(“ui-unselecting”); // add ui-selecting class to the elements to select $(elementsToSelect).not(“.ui-selected”).addClass(“ui-selecting”); // trigger the mouse stop event (this will select … Read more

JQuery Datepicker – no default date

I got round the problem using a hidden altField: <div id=”DatePicker”></div> <input type=”hidden” value=”” name=”Date” id=”Date” /> and the following script: <script> $(function () { $(‘#DatePicker’).datepicker({ altField: ‘#Date’, // ID of the hidden field altFormat: ‘dd/mm/yy’ }); // Remove the style for the default selected day (today) $(‘.ui-datepicker-current-day’).removeClass(‘ui-datepicker-current-day’); // Reset the current selected day $(‘#Date’).val(”); … Read more

How can I extend jQueryUI datepicker to accept an additional argument?

How about: var __picker = $.fn.datepicker; $.fn.datepicker = function(options) { __picker.apply(this, [options]); var $self = this; if (options && options.trigger) { $(options.trigger).bind(“click”, function () { $self.datepicker(“show”); }); } } Usage: $(“#date”).datepicker({ trigger: “#button” }); $(“#date2”).datepicker({ trigger: “#button2” }); Example: http://jsfiddle.net/gduhm/ Or, less intrusively with your own jQuery plugin: $.widget(“ui.datepicker2”, { _init: function() { var $el … Read more

how to close a bootstrap modal with the browser back button instead of going back a page?`

A better way i found thanks to http://www.mylearning.in/2015/06/close-modal-pop-up-on-back-button.html $(‘#myModal’).on(‘show.bs.modal’, function(e) { window.location.hash = “modal”; }); $(window).on(‘hashchange’, function (event) { if(window.location.hash != “#modal”) { $(‘#myModal’).modal(‘hide’); } });