I have some further ideas.
1.) Where we added:
Code:
<script type="text/javascript">
jQuery(function($){
$('button').click(function(e){e.stopPropagation(); $(this).parent().trigger('click');});
});
</script>
Make that:
Code:
<script type="text/javascript">
if(ddsmoothmenu.detecttouch){
jQuery(function($){
$('button').click(function(e){e.stopPropagation(); $(this).parent().trigger('click');})
.each(function(i, but){
but.addEventListener('touchstart', function(e){e.stopPropagation();}, false);
});
});
}
</script>
And get rid of:
Code:
ddsmoothmenu.init({
mainmenuid: "smoothmenu1", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
//customtheme: ["#1c5a80", "#18374a"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
It's not being used, and might be causing problems with the mobiles.
2.) Instead of using a script there at all, you could just get rid of the buttons entirely, the menu should then act properly. If you want them to still look like buttons, you could style the links using css to have an :active pseudo class that makes them look depressed when clicked. The :active pseudo class properties are in effect when a link is clicked and the mouse is in the down position. Something like:
Code:
.ddsmoothmenu-v#smoothmenu2 a:link {
background: url(regularbut.gif), center no-repeat;
}
.ddsmoothmenu-v#smoothmenu2 a:active {
background-image: url(depressedbut.gif);
}
A sprite would be better, if you know how to do that or want to learn, or the depressedbut.gif image could be preloaded.
3.) If all else fails we can do what you suggest, not use the menu script for mobiles. Again, skip that added script and just add the highlighted as shown (the red part should be removed, you're not using it):
Code:
<script type="text/javascript">
ddsmoothmenu.init({
mainmenuid: "smoothmenu1", //menu DIV id
orientation: 'h', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu', //class added to menu's outer DIV
//customtheme: ["#1c5a80", "#18374a"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
if(!ddsmoothmenu.detecttouch)
ddsmoothmenu.init({
mainmenuid: "smoothmenu2", //Menu DIV id
orientation: 'v', //Horizontal or vertical menu: Set to "h" or "v"
classname: 'ddsmoothmenu-v', //class added to menu's outer DIV
//method: 'toggle', // set to 'hover' (default) or 'toggle'
arrowswap: true, // enable rollover effect on menu arrow images?
//customtheme: ["#804000", "#482400"],
contentsource: "markup" //"markup" or ["container_id", "path_to_menu_file"]
})
</script>
Bookmarks