I have a page that will have a jquery photo gallery and a juqery slider among other things. The menu also will use jQuery.
For menu, I have a code resembling this:
$(‘.navbar li a’).click(function() {
target = $(this).attr(‘data-target’);
$(‘html, body’).animate({
scrollTop: $(target).offset().top
}, 800);
});
and then I thought of using easyslider for the photo gallery:
$(document).ready(function(){
$(“#slider”).easySlider({
auto: true,
continuous: true
});
});
but now the slider works, not the menu. Search sent me to do this:
var $j = jQuery.noConflict();
$j(document).ready(function(){
$j(“#slider”).easySlider({
auto: true,
continuous: true
});
});
I’ve called the jquery.js file only once and all the js code is in the same html file instead of creating a separate .js file for it.
but still the menu doesn’t work. I can’t seem to understand how to have all jQuery items working. Please help.