JQuery UI datepicker with arrow pointing the input
How do I make an jquery ui datepicker with arrow pointing the input?
What is a jquery ui datepicker with arrow pointing the input? How do you make a jquery ui datepicker with arrow pointing the input? This script and codes were developed by Berkin on 10 September 2022, Saturday.
JQuery UI datepicker with arrow pointing the input - Script Codes HTML Codes
<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>jQuery UI datepicker with arrow pointing the input</title> <link rel='stylesheet prefetch' href='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css'> <link rel="stylesheet" href="css/style.css">
</head>
<body> <input type="text" class="js-datepicker" />
<input type="text" class="js-datepicker r" />
<input type="text" class="js-datepicker r b" />
<input type="text" class="js-datepicker b" />
<input type="text" class="js-datepicker c " />
<input type="text" class="js-datepicker c b " /> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js'></script> <script src="js/index.js"></script>
</body>
</html>
JQuery UI datepicker with arrow pointing the input - Script Codes CSS Codes
input { position: absolute;
}
.c { left: 50%;
}
.r { right: 0; left: auto;
}
.b { bottom: 0;
}
JQuery UI datepicker with arrow pointing the input - Script Codes JS Codes
function drawArrow(input) { var $input = $(input), widget = $input.datepicker('widget'), direction; setTimeout(function() { console.log($input.offset()); console.log(widget.offset()); var inputOffset = $input.offset(), widgetOffset = widget.offset(); direction = inputOffset.top > widgetOffset.top ? 'down' : 'up'; widget.addClass('direction-' + direction); var arrow = widget.find('.datepicker-arrow'); if ( !arrow.length ) { arrow = $('<div class="datepicker-arrow"/>') .css({ width: 0, height: 0, borderStyle: 'solid', margin: '0 10px', position: 'absolute', }).appendTo(widget); } arrow.css({ left: inputOffset.left - widgetOffset.left, borderColor: direction === 'up' ? 'transparent transparent red' :'red transparent transparent' , borderWidth: direction === 'up' ? '0 10px 10px 10px' : '10px 10px 0 10px', top: direction === 'up' ? '-10px' : 'auto', bottom: direction === 'up' ? 'auto' : '-10px' }); }, 10);
}
$('.js-datepicker').datepicker({ format: 'dd.mm.yyyy', beforeShow: function(input, inst) { drawArrow(input); }, onChangeMonthYear: function(a,b) { console.log(this, a,b); var $input = $(this), widget = $(this).datepicker('widget'); drawArrow(this); }
});
Developer | Berkin |
Username | berkin |
Uploaded | September 10, 2022 |
Rating | 3 |
Size | 2,246 Kb |
Views | 50,600 |
Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!
Name | Size |
Javascript - Merge Sort | 1,509 Kb |
Big factorial | 1,567 Kb |
IOS style alphabetic scroll | 3,488 Kb |
Simple carousel | 3,098 Kb |
Tap and hold carousel with hammer.js | 4,945 Kb |
Touch Carousel | 3,901 Kb |
Merge overlapping intervals | 1,889 Kb |
Touch Carousel - First One | 3,901 Kb |
Pull to Refresh | 2,528 Kb |
Javascript - Selection Sort | 1,577 Kb |
Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!
Name | Username | Size |
Vertical Pan Hammer.js example | Jtangelder | 2,144 Kb |
Display properties | Hamzaerbay | 1,886 Kb |
Airbnb Homepage | SindhujaD | 2,480 Kb |
NT Tribute | Skybutterfly | 2,850 Kb |
Weird glowy CSS3 game | Toneworm | 3,684 Kb |
CSS- UI Element States Pseudo-Classes | Tesla809 | 2,206 Kb |
Tumblr API | Juanv911 | 2,436 Kb |
DevCamp 2014 - Denver Public Library | See8ch | 5,033 Kb |
WRENCH - STAFF | Lolita-adams | 1,608 Kb |
SlideDown FixedMenu | Mp_graphic | 5,602 Kb |
Surf anonymously, prevent hackers from acquiring your IP address, send anonymous email, and encrypt your Internet connection. High speed, ultra secure, and easy to use. Instant setup. Hide Your IP Now!