I use the "Nice Menus" module to create drop down menus for my sites. They work on iPhone and iPad browsers. However, after activating "Special Menu Items" these drop downs do not work on the iPhone or iPad.

Any help or insight would be appreciated.

Thanks

CommentFileSizeAuthor
#6 specialmenuitems.png14.98 KBmherchel

Comments

jbenjamin’s picture

I'm in the same situation. Anyone had any luck getting this to work?

johnvb’s picture

Same problem here. Clicking on the special menu item on an IPhone just reloads the page rather than dropping the menu down (even though it is not a link). The other non-special menu items still work.

chrislabeard’s picture

subscribe

spencerfromsc’s picture

In case it helps, the module is working fine in Acquia Marina right now, but I am having the same issue as the original post (it doesn't reload the page as in #3) in the Safari browser on the iphone. Wish I could be helpful enough to throw a patch your way, but I'd probably do more harm than good at this point.

jfox77’s picture

subscribe

mherchel’s picture

StatusFileSize
new14.98 KB

I was able to get this working by navigating to admin/settings/special_menu_items, and inserting the following into the "HTML TAG FOR NOLINK" Field:

<a href="#">



grasmash’s picture

awesome. I had tried using the anchor tag but hadn't thought to add the href="#". Thanks!

jdanthinne’s picture

Nice solution!
But if you use that, changes must be done in the code (in function render_menu_item).
Replace all $closingtag=str_replace('<','</',$tag); by $closingtag = preg_replace('/<(\w).*>/', '</$1>', $tag);.
This way, the closing tag is </a>, and not </a href="#">.

gagarine’s picture

Status: Active » Closed (duplicate)

Close as a duplicate.
We should solve #1221294: option to use <a href="#"> for "nolink" items to not break other modules and it will certainly works.

3rdvalve’s picture

In addition to the above we've added a class to our stylesheets to override the pointer cursor.

In the css:
a.no-link {
cursor:text;
}

asad.hasan’s picture

Status: Closed (duplicate) » Fixed
asad.hasan’s picture

Component: Miscellaneous » User interface
Assigned: Unassigned » asad.hasan

Stick this code in to your themes javascript file. It will allow users to view the menu on one tap, and go to the url on the menu on a second tap if done with in one second. Has been Tested and multiple levels on IOS and Android. Thanks.

;window.Modernizr=function(a,b,c){function v(a){i.cssText=a}function w(a,b){return v(l.join(a+";")+(b||""))}function x(a,b){return typeof a===b}function y(a,b){return!!~(""+a).indexOf(b)}function z(a,b,d){for(var e in a){var f=b[a[e]];if(f!==c)return d===!1?a[e]:x(f,"function")?f.bind(d||b):f}return!1}var d="2.6.2",e={},f=b.documentElement,g="modernizr",h=b.createElement(g),i=h.style,j,k={}.toString,l=" -webkit- -moz- -o- -ms- ".split(" "),m={},n={},o={},p=[],q=p.slice,r,s=function(a,c,d,e){var h,i,j,k,l=b.createElement("div"),m=b.body,n=m||b.createElement("body");if(parseInt(d,10))while(d--)j=b.createElement("div"),j.id=e?e[d]:g+(d+1),l.appendChild(j);return h=["&#173;",'<style id="s',g,'">',a,"</style>"].join(""),l.id=g,(m?l:n).innerHTML+=h,n.appendChild(l),m||(n.style.background="",n.style.overflow="hidden",k=f.style.overflow,f.style.overflow="hidden",f.appendChild(n)),i=c(l,a),m?l.parentNode.removeChild(l):(n.parentNode.removeChild(n),f.style.overflow=k),!!i},t={}.hasOwnProperty,u;!x(t,"undefined")&&!x(t.call,"undefined")?u=function(a,b){return t.call(a,b)}:u=function(a,b){return b in a&&x(a.constructor.prototype[b],"undefined")},Function.prototype.bind||(Function.prototype.bind=function(b){var c=this;if(typeof c!="function")throw new TypeError;var d=q.call(arguments,1),e=function(){if(this instanceof e){var a=function(){};a.prototype=c.prototype;var f=new a,g=c.apply(f,d.concat(q.call(arguments)));return Object(g)===g?g:f}return c.apply(b,d.concat(q.call(arguments)))};return e}),m.touch=function(){var c;return"ontouchstart"in a||a.DocumentTouch&&b instanceof DocumentTouch?c=!0:s(["@media (",l.join("touch-enabled),("),g,")","{#modernizr{top:9px;position:absolute}}"].join(""),function(a){c=a.offsetTop===9}),c};for(var A in m)u(m,A)&&(r=A.toLowerCase(),e[r]=m[A](),p.push((e[r]?"":"no-")+r));return e.addTest=function(a,b){if(typeof a=="object")for(var d in a)u(a,d)&&e.addTest(d,a[d]);else{a=a.toLowerCase();if(e[a]!==c)return e;b=typeof b=="function"?b():b,typeof enableClasses!="undefined"&&enableClasses&&(f.className+=" "+(b?"":"no-")+a),e[a]=b}return e},v(""),h=j=null,e._version=d,e._prefixes=l,e.testStyles=s,e}(this,this.document);

Drupal.behaviors.touchDevices = function(context) {
	if(window.Modernizr.touch) {
		$('ul.nice-menu', context).find('li.menuparent > a').click(function(e) {
			var $this = $(this);
			if(typeof $this.data('oneTap') == "undefined" || $this.data('oneTap') == false) {
				e.preventDefault();
				e.stopPropagation();
				$this.data('oneTap', true);
				setTimeout(function() {
					$this.data('oneTap', false);
				}, 1000);
			}
		});
	}
}
hallswah’s picture

Will this work for drupal 7 as well?

also could you please tell me exactly which js file i should be adding this to - i'm using the danland theme which has a scripts folder that contains superfish.js, jquery.cycle.all.js and hoverIntent.js

Thank you in advance

asad.hasan’s picture

I have not tested this on Drupal 7. Superfish is not the same thing as Nice Menus, Superfish is touch compatible from my experience.

As far as the Javascript file is concerned, you should be able to throw it in any javascript file within your theme, however, I recommend creating a separate Javascript file in your themes javascript folder, and adding it to the .info file provided with your theme or basetheme.

Thank you

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.

Pierre__’s picture

Issue summary: View changes

Special menu items (7.x-2.1) is still not working on Ipad and iphones.
I tried using instead of but this does not work.
Is there a CSS trick to let it working or do we have to use javascript?

Thanks