Reply To: href not working on parent as expected

Home Forums Older releases 1.0.x href not working on parent as expected Reply To: href not working on parent as expected

#3025
admin
Keymaster

Here is some sample code that will make the main menu links load on first click/tap in mobile view:

$(function() {
	var $mainMenu = $('#main-menu');

	// don't show the sub menus in collapsible mode unless the sub arrow is clicked
	$mainMenu.on('click', 'span.sub-arrow', function(e) {
			var obj = $mainMenu.data('smartmenus');
			if (obj.isCollapsible()) {
				var $item = $(this).parent(),
					$sub = $item.closest('li').dataSM('sub');
				$sub.dataSM('arrowClicked', true);
			}
		}).bind({
			'beforeshow.smapi': function(e, menu) {
				var obj = $mainMenu.data('smartmenus');
				if (obj.isCollapsible()) {
					var $menu = $(menu);
					if (!$menu.dataSM('arrowClicked')) {
						return false;
					}
					$menu.removeDataSM('arrowClicked');
				}
			}
		});
});

Please let me know if you have any troubles.

Cheers!

Register

You will be emailed a link to set your password.

Login

Lost password?