Skip to content

Instantly share code, notes, and snippets.

Avatar

Alexandru Trandafir Catalin atrandafir

View GitHub Profile
@atrandafir
atrandafir / index.html
Created Aug 17, 2018
Drop Down Menu/Text Field in one jQuery autocomplete based solution
View index.html
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>jQuery UI Autocomplete - Scrollable results</title>
<link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css">
<link rel="stylesheet" href="/resources/demos/style.css">
<style>
.ui-autocomplete {
@atrandafir
atrandafir / jquery.readOnlyBlur
Last active Dec 19, 2015
Blur a readonly text field because by default jQuery.blur() does not do it.
View jquery.readOnlyBlur
(function($) {
$.fn.readOnlyBlur = function() {
return this.each(function() {
if ($(this).is('input')) {
if ($(this).is('[readonly]')) {
var readonly_var=$(this).attr("readonly");
$(this).removeAttr("readonly");
$(this).blur();
$(this).attr("readonly",readonly_var);
} else {