responsive-nav.js icon indicating copy to clipboard operation
responsive-nav.js copied to clipboard

responsive-nav.js instead for a navigation for a div

Open Basti10 opened this issue 10 years ago • 7 comments

hello how can I use your responsive-nav.js to hide a div on mobile devices?

The navigation is visible on large screens and the navigation is not visible on small screens. The toggle button is visible on small screens and the navigation will be displayed after clicking on the button. This is your example.

I would like to use your script, but instead for a navigation for a div. Is this possible?

Basti10 avatar Jul 13 '15 07:07 Basti10

Simply use CSS media queries to achieve this. https://developer.mozilla.org/en-US/docs/Web/Guide/CSS/Media_queries

Aybee avatar Jul 13 '15 08:07 Aybee

I think because of my bad English You do not understand what I mean.

I try again: I have a div (ID infobox). On small devices these div should be hidden. And a button should be displayed. The div infobox should appear after clicking on the button.

Basti10 avatar Jul 14 '15 09:07 Basti10

Yes you can do that exactly the same way as it would be nav element.

samikeijonen avatar Jul 14 '15 09:07 samikeijonen

Ah, ok I see. If you're not using responsive-nav.js you should not run responsive-nav.js to manage that. It's easier by changing/adding/removing a class after a click event. You will get help on stackoverflow.com.

If you run responsive-nav.js maybe you could use the functions addClass() https://github.com/viljamis/responsive-nav.js/blob/master/responsive-nav.js#L145-L156 and removeClass() https://github.com/viljamis/responsive-nav.js/blob/master/responsive-nav.js#L158-L167

Maybe viljamis can give an example how to use them.

Aybee avatar Jul 14 '15 11:07 Aybee

Many thanks for your responses! I'll try to understand the script. I do not know much about javascript Have a nice day

Basti10 avatar Jul 15 '15 06:07 Basti10

Unfortunately I am not able to solve my problem. can someone help me?

Basti10 avatar Jul 27 '15 12:07 Basti10

PLEASE HELP ME

Basti10 avatar Aug 09 '15 12:08 Basti10