Plugin rewritten from ground up

Version 2.0
This commit is contained in:
LebCit
2018-11-22 20:05:59 +02:00
parent 9c68e0dd59
commit 97d20e9a81
277 changed files with 61349 additions and 2 deletions
+34
View File
@@ -0,0 +1,34 @@
// When the document is ready...
jQuery(document).ready(function ($) {
// Display the Full Screen search when The user focuses on a search field
$('form[role=search] input').on('focus', function (event) {
// Prevent the default action
event.preventDefault();
// Display the Morphing Search Page
$('.morphsearch').addClass('open');
// Focus on the Morphing Search Input Field
$('.morphsearch input.morphsearch-input').focus();
});
// Hide the Morphing Search Page when the user clicks the close span
$('.morphsearch span.morphsearch-close').on('click', function (event) {
// Prevent the default event
event.preventDefault();
// Hide the Morphing Search Page
$('.morphsearch').removeClass('open');
});
// Hide the Morphing Search Page when the user press on the Escape key
$('.morphsearch').on('keydown', function (event) {
if (event.keyCode === 27) {
$('.morphsearch').removeClass('open');
}
});
// Reset Morphing Search Input Value to Search...
$('input.search-field').val('');
});