- 135 views
Identify your ID of Superfish Block
It should be something like:
#block-superfish-1
Append this script to your Scripts.js file in theme folder.
// helper function
function checkValue(value,arr){
var status = 'Not exist';
for(var i=0; i<arr.length; i++){
var name = arr[i];
if(name == value){
status = 'Exist';
break;
}
}
return status;
}
// make an array
var menu_links_arr = [];
$('#block-superfish-1 li a.menuparent').click(function(){
if (checkValue($(this).attr("id"), menu_links_arr) == 'Exist') {
console.log("second click");
// redirects automatically
}
else {
// first click, do not redirect
menu_links_arr.push($(this).attr("id"));
return false;
}
});
Now just replace #block-superfish-1 with your Superfish block ID.
Fixed!
Easy as that. What it essentially does is that it makes an array of IDs of menu items, and if you click on any parent menu item, it pushes the ID of so called menu item to array. Now on second tap, if the ID is already in array, just do nothing and let Superfish module redirect to subpage as it does normally.