10 examples of 'jquery disable dropdown' in JavaScript

Every line of 'jquery disable dropdown' code snippets is scanned for vulnerabilities by our powerful machine learning engine that combs millions of open source libraries, ensuring your JavaScript code is secure.

All examples are scanned by Snyk Code

By copying the Snyk Code Snippets you agree to
67function toggle_dropdown(){
68 $('.btn-group.open').removeClass('open');
69}
76function closeDropdown () {
77 Dropdown.componentInstance.hide()
78}
81function closeDropdownFn() {
82 jqLite.removeClass(menuEl, openClass);
83
84 // remove event handlers
85 jqLite.off(doc, 'click', closeDropdownFn);
86}
151function dropDownMenu (trigger_id) {
152
153 // console.log('Trigger ID: ' + trigger_id);
154
155 // get Menu-Item position X/Y
156 var menuItemH = $(trigger_id).height();
157 // console.log(menuItemH);
158 var menuPos = $('#'+trigger_id).offset();
159 // console.log(menuPos);
160
161 var menuPosY = parseInt(menuPos.top) + 25;
162 var menuPosX = parseInt(menuPos.left) - 10; // dropdown content has 10px margin.
163
164 var dropDownMenuID = $("#"+trigger_id).next('ul').attr('id');
165
166 if (!dropDownMenuID) {
167 dropDownMenuID = trigger_id + '-content';
168 $("#"+trigger_id).next('ul').attr('id', dropDownMenuID);
169 }
170
171 $("#"+dropDownMenuID).insertAfter('#footer');
172 $("#"+dropDownMenuID).css({
173 top: menuPosY,
174 left: menuPosX
175 }).slideDown('fast');
176
177 return true;
178}
76function closeDropdownFn() {
77 jqLite.removeClass(menuEl, openClass);
78
79 // remove event handlers
80 jqLite.off(doc, 'click', closeDropdownFn);
81 jqLite.off(doc, 'keydown', handleKeyDownFn);
82}
26closeDropDown() {
27 this.item.find(".dropdown-content").removeClass('show');
28 $(window).off('click', this.dropWatch);
29}
274_hide($elem, idx) {
275 var $toClose;
276 if ($elem && $elem.length) {
277 $toClose = $elem;
278 } else if (idx !== undefined) {
279 $toClose = this.$tabs.not(function(i, el) {
280 return i === idx;
281 });
282 }
283 else {
284 $toClose = this.$element;
285 }
286 var somethingToClose = $toClose.hasClass('is-active') || $toClose.find('.is-active').length > 0;
287
288 if (somethingToClose) {
289 $toClose.find('li.is-active').add($toClose).attr({
290 'aria-expanded': false,
291 'data-is-click': false
292 }).removeClass('is-active');
293
294 $toClose.find('ul.js-dropdown-active').attr({
295 'aria-hidden': true
296 }).removeClass('js-dropdown-active');
297
298 if (this.changed || $toClose.find('opens-inner').length) {
299 var oldClass = this.options.alignment === 'left' ? 'right' : 'left';
300 $toClose.find('li.is-dropdown-submenu-parent').add($toClose)
301 .removeClass(`opens-inner opens-${this.options.alignment}`)
302 .addClass(`opens-${oldClass}`);
303 this.changed = false;
304 }
305 /**
306 * Fires when the open menus are closed.
307 * @event DropdownMenu#hide
308 */
309 this.$element.trigger('hide.zf.dropdownmenu', [$toClose]);
310 }
311}
23function hideOnBlur(elem: any, state: any, event: any) {
24 if (!elem.contains(event.target)) {
25 state.dropdownOpen(false);
26 }
27}
101showDropdown() {
102 if (!this.dropdownMenu.hasClass('show')) {
103 this.dropdownToggle.dropdown('toggle');
104 }
105}
119closeDropdown() {
120 // Don't use ng-class here, it could cause issue on positionning.
121 this.isDropdownOpen = false;
122 this.destroyPopper();
123
124 this.$document.off('click', this.documentClickHandler);
125
126 // Update trigger
127 if (this.triggerCtrl.afterClose) {
128 this.triggerCtrl.afterClose();
129 }
130}

Related snippets