Created
January 23, 2018 21:37
-
-
Save shreyans94/0a2a2f96968dc65ba43aa9647c4e7d5f to your computer and use it in GitHub Desktop.
Add scroll feature in Guaven Woo Search Box Plugin
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function custom_guaven_js(){ | |
?> | |
<script> | |
jQuery(window).scroll(function(){ | |
var guaven_woos_offset = jQuery('.header-search-form-wrapper [name="s"]').offset(); | |
jQuery(".guaven_woos_suggestion").css('left', guaven_woos_offset.left); | |
jQuery(".guaven_woos_suggestion").css('top', guaven_woos_offset.top + parseFloat(jQuery('.header-search-form-wrapper [name="s"]').outerHeight())); | |
}); | |
</script> | |
<?php | |
} | |
add_action('wp_footer','custom_guaven_js'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment