June 12, 201412 yr Hi, I've got to a point with this project where I'm beginning to pull my hair out. The problem I have is I've styled what I think is a good drop down menu based on tutorials etc online. Everything looks as I want and works fine on a desktop. But when you try and use the drop down menu on a touch screen device, the menu doesn't stay down - you can't select another page. Can anyone advise please. The project is here - http://www.clearstreamdesign.co.uk/chesters2014/ Thanks.
June 13, 201412 yr I would avoid setting any responsive menu to display on hover. Try something like http://responsive-nav.com
June 13, 201412 yr Repeating what Jack said, a hover-activated mobile menu makes literally no sense, as hovering doesn't exist on mobile/tablet. Your mobile menu is also quite uncomfortable to use in a desktop browser too, actually. I'd keep it simple - make it clickable.
June 17, 201412 yr please every one I'm just a newbie to webdesign and was trying to get myself with CSS drop down menu but my problem now is that i' m having issues with some lines of the solution I got. I will post after this message.
June 17, 201412 yr .menu { border :none ; border :0px ; margin :0px ; padding :0px ; font: 67.5 % "Lucida Sans Unicode" , "Bitstream Vera Sans" , "Trebuchet Unicode MS", "Lucida font- size: 14px; font- weight :bold ; } .menu ul{ background:#F93; height :50px ; list- style :none ; margin :0; padding :0; -webkit -border - radius : 15px ; -moz- border -radius : 15px; border -radius : 15px; -webkit -box -shadow : inset 0px 16px 0px 0px rgba (255 , 255 , 255 , .1 ); -moz- box-shadow : inset 0px 16px 0px 0px rgba( 255, 255, 255, .1); box-shadow : inset 0px 16px 0px 0px rgba( 255, 255, 255, .1); } .menu li{ float :left ; padding :0px 0px 0px 15px; } .menu li a { color :#000; display :block ; font- weight :normal ; line- height :50px ; margin :0px ; padding :0px 25px ; text- align :center ; text- decoration:none ; } .menu li a :hover { background:#C60; color :#FFFFFF; text- decoration:none ; -webkit -box -shadow : inset 0px 0px 7px 2px rgba (0, 0, 0, .3); -moz- box-shadow : inset 0px 0px 7px 2px rgba (0 , 0, 0, .3 ); box-shadow : inset 0px 0px 7px 2px rgba (0 , 0, 0, .3 ); } .menu ul li :hover a{ background:#C60; color :#FFFFFF; text- decoration:none ; } .menu li ul { display :none ; height :auto ; padding :0px ; margin :0px ; border :0px ; position:absolute; width :200px ; z-index :200 ; } .menu li:hover ul{ display :block ; } .menu li li { display :block ; float :none ; margin :0px ; padding :0px ; width :200px ; background:#F93; /*this is where the rounded corners for the dropdown disappears*/ } .menu li:hover li a{ background:none ; } .menu li ul a{ display :block ; height :50px ; font- size: 12px; font- style :normal ; margin :0px ; padding :0px 10px 0px 15px ; text- align :left ; } .menu li ul a:hover , .menu li ul li :hover a{ border :0px ; color :#ffffff; text- decoration:none ; background:#C60; -webkit -box -shadow : inset 0px 0px 7px 2px rgba (0, 0, 0, .3); -moz- box-shadow : inset 0px 0px 7px 2px rgba (0 , 0, 0, .3 ); box-shadow : inset 0px 0px 7px 2px rgba (0 , 0, 0, .3 ); }
June 17, 201412 yr this is are the lines that I'm having issues below webkit -border - radius : 15px ; -moz- border -radius : 15px; border -radius : 15px; -webkit -box- shadow : inset 0px 16px 0px 0px rgba (255, 255, 255, .1); -moz- box-shadow : inset 0px 16px 0px 0px rgba( 255, 255, 255, .1); box-shadow : inset 0px 16px 0px 0px rgba( 255, 255, 255, .1); } . ........,..........................................................................
June 18, 201412 yr use this code... -webkit-border-radius : 15px ; -moz-border-radius : 15px; border-radius : 15px; -webkit-box-shadow : inset 0px 16px 0px 0px rgba (255 , 255 , 255 , .1 ); -moz-box-shadow : inset 0px 16px 0px 0px rgba( 255, 255, 255, .1); box-shadow : inset 0px 16px 0px 0px rgba( 255, 255, 255, .1);
June 18, 201412 yr jerseydudek - Have you tried aria haspopup? This means that when you touch a drop down menu, the drop down items stay visible allowing you to touch the drop down item you require, otherwise the drop down items disappear as you move your finger over them to select the item you want. http://www.w3.org/TR/wai-aria/states_and_properties#aria-haspopup msdn.microsoft.com/en-gb/library/ie/jj152135(v=vs.85).aspx example here: http://stackoverflow.com/questions/3474099/what-is-html5-aria Edited June 18, 201412 yr by Wickham
June 19, 201412 yr You should use javascript to toggle the dropdown menu on click for touch screens. Or you can have no dropdown on the touch screens but the main link would take you to a landing page that lists the other sub-pages. EDIT just checked your link. Why not go with a toggle option to open the menu on tablets, like others have said don't use a hover state. You need javascript for the click event. A common icon for this toggling of the main navigation is a box with a list of 3 lines inside, commonly referred to as a burger icon. Edited June 19, 201412 yr by rbrtsmith
Create an account or sign in to comment