Hi
i have a problem with using jquery in my wordpress theme.
it's code use to fixing a element after some scrolling
this is the jquery
jQuery(document).scroll(function($) {
var y = $(document).scrollTop(), //get page y value
header = $("#aside"); // your div id
if(y >= 305) {
header.css({position: "fixed", "top" : "0", "left" : "0"});
} else {
header.css("position", "static");
}
});
and i use this code to add the file to wordpress theme in function.php
function website_scripts () {
wp_enqueue_script('aside_scroll', get_template_directory_uri().'/js/aside_scroll.js', array('jquery'), '1.0.0', true); }
add_action ('wp_enqueue_scripts', 'website_scripts');
but it's not working in wordpress however it works in html file