I’m having trouble with the shopping cart toggle drop down, When I click the drop down the link doesn’t take me to the link location but does on everything else.
Here is my coding, am i doing anything wrong? Any help would be great.
$(document).ready(function(){
// Drop Menu
$('.navigation > ul > li > a').click(function(e){
if($(this).parent().hasClass('current')){
$(this).parent().removeClass('current');
}else{
$(this).parent().addClass('current');
}
if($(this).parent().find('ul')){
e.preventDefault();
}
});
$('.shoppingbasket > ul > li').click(function(e){
if($(this).hasClass('current')){
$(this).removeClass('current');
}else{
$(this).addClass('current');
}
if($(this).parent().find('ul')){
e.preventDefault();
}
});
$(".navigation ul ul, .shoppingbasket ul ul").css({display: "none"});
$(".navigation ul li, .shoppingbasket ul li").click(function(){
$(this).find('ul:first').slideToggle(400);
});
});
There are few issues in your code, try this