JSFiddle - React, Tailwind, and code Playground
HTML
<div id="form-search">
<form action="/search" id="ajax-search-form">
<input name="q" type="text" />
<input type="submit" value="Search" />
</form>
</div>
CSS
* {
box-sizing: border-box;
}
#search-result * {
margin: 0 0 0 0;
padding: 0 0 0 0;
}
li {
display: list-item;
}
#form-search {
position: absolute;
width: 200px;
left: 200px;
top: 4px;
}
#ajax-search-form {
position: relative;
font: normal normal 13px Arial, Sans-Serif;
}
#ajax-search-form input {
border: 1px solid #e3e3e3;
background-color: white;
font: normal normal 12px/100% Arial, Sans-Serif;
color: black;
margin: 0 0;
height: 22px;
line-height: 22px;
padding: 0 5px;
width: 140px;
}
#ajax-search-form input[type="submit"] {
width: auto;
background-color: #49afcd;
border: none;
color: white;
font-weight: bold;
cursor: pointer;
font-size: 12px;
}
#search-result {
background-color: #49afcd;
padding: 5px 2px;
margin: 2px 0;
width: 300px;
overflow: auto;
max-height: 710px;
position: absolute;
right: 6px;
top: 28px;
z-index: 99;
color: white;
border-radius: 0 0 3px 3px;
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1), 0 1px 2px rgba(0, 0, 0, 0.3);
display: none;
}
#search-result .close {
display: block;
position: absolute;
top: 2px;
font-size: 20px;
right: 10px;
line-height: normal;
color: white;
}
#search-result ul {
margin: 0;
overflow: hidden;
max-height: 405px;
border-bottom: 1px solid #45A5C2;
border-top: 1px solid #45A5C2;
list-style:none
}
#search-result li {
height: 68px;
overflow: hidden;
padding: 0 5px;
border-top: 1px solid #45A5C2;
border-bottom: 1px solid #45A5C2;
position: relative;
}
#ajax-search-form a {
color: #741F27;
text-decoration: none;
}
#search-result h4 {
display: block;
margin: 0 0 10px 5px;
color: white;
}
#search-result p {
font-size: 10px;
color: white;
}
#search-result span {
width: 50px;
height: 50px;
display: block;
float: left;
padding: 2px;
margin-right:...
JavaScript
jQuery.easing.jswing = jQuery.easing.swing;
jQuery.extend(jQuery.easing, {
def: "easeOutQuad",
swing: function (x, t, b, c, d) {
return jQuery.easing[jQuery.easing.def](x, t, b, c, d)
},
easeInQuad: function (x, t, b, c, d) {
return c * (t /= d) * t + b
},
easeOutQuad: function (x, t, b, c, d) {
return -c * (t /= d) * (t - 2) + b
},
easeInOutQuad: function (x, t, b, c, d) {
if ((t /= d / 2) < 1) {
return c / 2 * t * t + b
}
return -c / 2 * ((--t) * (t - 2) - 1) + b
},
easeInCubic: function (x, t, b, c, d) {
return c * (t /= d) * t * t + b
},
easeOutCubic: function (x, t, b, c, d) {
return c * ((t = t / d - 1) * t * t + 1) + b
},
easeInOutCubic: function (x, t, b, c, d) {
if ((t /= d / 2) < 1) {
return c / 2 * t * t * t + b
}
return c / 2 * ((t -= 2) * t * t + 2) + b
},
easeInQuart: function (x, t, b, c, d) {
return c * (t /= d) * t * t * t + b
},
easeOutQuart: function (x, t, b, c, d) {
return -c * ((t = t / d - 1) * t * t * t - 1) + b
},
easeInOutQuart: function (x, t, b, c, d) {
if ((t /= d / 2) < 1) {
return c / 2 * t * t * t * t + b
}
return -c / 2 * ((t -= 2) * t * t * t - 2) + b
},
easeInQuint: function (x, t, b, c, d) {
return c * (t /= d) * t * t * t * t + b
},
easeOutQuint: function (x, t, b, c, d) {
return c * ((t = t / d - 1) * t * t * t * t + 1) + b
},
easeInOutQuint: function (x, t, b, c, d) {
if ((t /= d / 2) < 1) {
return c / 2 * t * t * t * t * t + b
}
return c / 2 * ((t -= 2) * t * t * t * t + 2) + b
},
easeInSine: function (x, t, b, c, d) {
return -c * Math.cos(t / d * (Math.PI / 2)) + c + b
},
easeOutSine: function (x, t, b, c, d) {
return c * Math.sin(t / d * (Math.PI / 2)) + b
},
...