Skip to content

Instantly share code, notes, and snippets.

View atrandafir's full-sized avatar

Alexandru Trandafir Catalin atrandafir

View GitHub Profile
@atrandafir
atrandafir / index.html
Created August 17, 2018 16:19
Drop Down Menu/Text Field in one jQuery autocomplete based solution
<!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 December 19, 2015 17:29
Blur a readonly text field because by default jQuery.blur() does not do it.
(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 {