[Javascript issues] Mobile Menu content

Status
Not open for further replies.

Magic

Posting Freak
Oct 11, 2012
1,026
196
Hello,

So I am basically stuck on this last thing for my portfolio, when the user is for example, viewing my website on their iPhone the menu will hide and a small bar will show instead like so:
j6TbfrT.jpg

and than when that is tapped it turns into this:
vjouT1q.jpg

where I than want a simple list menu to appear.
The code for the toggling of the bar is as follows:
HTML:
function toggleClass(el) {
    if(el.className == "show-menu"){
        el.className = "navi_mob";
    } else {
        el.className = "show-menu";
    }
}

Does anyone know how to than display a menu of:
HTML:
<ul>
         <li><a href="index.html">Home</a></li>
         <li><a href="webdev.html">Web Development</a></li>
         <li><a href="photography.html">Photography</a></li>
         <li><a href="about.html">About</a></li>
          <li><a href="contact.html">Contact</a></li>
</ul>
 

Magic

Posting Freak
Oct 11, 2012
1,026
196
I am not remaking the wheel modify this to fit your needs i have tested it on mobile, tablet and desktop it works.


JSFIDDLE:
I'll see if I can get it to work, probably not though since I already have a perfectly working menu for screen sizes above 592px so i don't know if integrating this will looks to flash. I'll give it my best shot though. Meanwhile i'll still take other solutions which might be easier to integrate into my code.

EDIT: I have configured the mobile menu to work with my website successfully, Thank you for your answer and help.

Close thread I suppose.
 
Last edited:

Marlboro20

Member
Dec 17, 2013
37
6
I'll see if I can get it to work, probably not though since I already have a perfectly working menu for screen sizes above 592px so i don't know if integrating this will looks to flash. I'll give it my best shot though. Meanwhile i'll still take other solutions which might be easier to integrate into my code.

EDIT: I have configured the mobile menu to work with my website successfully, Thank you for your answer and help.

Close thread I suppose.
WAIT i found a better method :p
That is what your trying to do right?
 
Status
Not open for further replies.

Users who are viewing this thread

Top