Home › Forums › JavaScript › Need help with js for center menu on district website
- This topic is empty.
-
AuthorPosts
-
September 4, 2014 at 11:20 am #181686
atjones44
ParticipantI’ve been asked to change it from hover effect to clickable.
Im not having any luck what so ever since javascript is new to me. I will have to buy a book on it.
I have here a jsfiddle of the menu. http://jsfiddle.net/atjones44/62k19ffn/12/
Can anyone do up a simple js code for onclick events to open the menu, rather than :hover css effects
live site can be seen at usd430.k12.ks.usSeptember 4, 2014 at 1:37 pm #181704Paulie_D
MemberWhat happens if JS is not enabled by the user?
Are you worried about the menu not working not working in that case?
September 4, 2014 at 1:42 pm #181706atjones44
ParticipantI haven’t really thought about that. Since there is no real easy way to achieve this with css, as long as it works on our district computers for our staff and students, I really don’t care. if the end user disabled js at home then its their own problem I guess.
thanks for the help ahead of time
- Andrew Jones
USD430
September 4, 2014 at 1:49 pm #181708Paulie_D
MemberSo you don’t want any hover action at all?
The only way to get to the submenu will be a click?
Just checking as that’s not really a thing that you see very often.
September 4, 2014 at 1:53 pm #181710atjones44
ParticipantRight, the grade school teachers have complained that with KDG and 1st graders don’t really have the hand / eye coordination to handle the hover effect because the menu keeps disappearing on them lol.
I’d like a click to open the first nav and then a click to open the submenus there if possible.
I use jquery on the site already for usd430 news and stuff so being js shouldn’t matter really. will it still work with mobile devices?September 4, 2014 at 2:12 pm #181713Paulie_D
MemberOk…I’ll take a look but I think we’ll need to tidy up some of the HTML errors you have in the fiddle.
will it still work with mobile devices?
I think so, but I’m not up on mobile & clicks with JQ.
September 4, 2014 at 4:21 pm #181733atjones44
ParticipantThanks much!
September 4, 2014 at 4:39 pm #181735Soronbe
ParticipantI think so, but I’m not up on mobile & clicks with JQ.
Mobile devices with touchscreen often dont have a “click” event. In most cases they use events like “touchstart” “touchmove” and “touchend”.
September 4, 2014 at 11:31 pm #181764Paulie_D
MemberMobile devices with touchscreen often dont have a “click” event. In most cases they use events like “touchstart” “touchmove” and “touchend”.
Oh..yeah…I was aware of those just not on he implementation…still researching.
Unfortunately I have to be away this weekend so I may not be able to do much until Monday.
September 5, 2014 at 5:54 am #181783atjones44
ParticipantThat is totally fine, thank you for the help you’re willing to do for me and the school district.
September 5, 2014 at 5:56 am #181784atjones44
ParticipantThe only way I got touchscreen devices to work with the hover menu was by adding
<span> menu html is here </span>
January 8, 2015 at 1:30 pm #192662atjones44
ParticipantHey Guys, just still messing with the center menu on the website. I’d still like to make the menu, clickable if possible rather than hover like it currently is. Even if its not js that does it.
January 8, 2015 at 7:16 pm #192681Shikkediel
ParticipantI thought this wouldn’t be too complicated but the HTML looks scrambled and to be honest the CSS made my head spin. I think this isn’t so much a js issue – that bit of code looks pretty close and click events should work normally on touch screens (just slightly delayed).
January 9, 2015 at 12:05 am #192693atjones44
ParticipantThink its doable? Or will it not work? I can try to find a new menu that will do more of what I need.
Again thanks for your help.January 9, 2015 at 6:56 am #192719Shikkediel
ParticipantIt’s certainly doable, I just got disheartened a bit. The HTML has some stray tags I think but the CSS would need a rewriting. The js should only require some minor coding then (I’ll take another, fresh look).
- Andrew Jones
-
AuthorPosts
- The forum ‘JavaScript’ is closed to new topics and replies.