So i'm trying to make my schools navigation bar a little bit more mobile friendly. If you navigate to www.jpc.wa.edu.au on a mobile device, and click on the menu item "Resources" - A drop down menu opens up with two options. Mousing over these with a desktop computer gives you another menu to the right of the first. This works fine on a large screen. However, anything that has a resolution lower than roughly 1460px, such as most tablets, phones, or even laptops, the new menu gets cut off and you have to pan the window left to view it. I would like to avoid this problem completely by simply positioning the second submenu to the left of the first submenu on smaller screens. Determining screen size I can do.
if(window.innerWidth<1460)
Works perfectly fine. The problem i'm having is that I can't seem to access the second submenus left property to modify the menus position from my javascript
In my CSS, I set it by using the following selector
#horizonMenu
But when I try to use this selector in Javascript using
document.querySelector("#horizonMenu").style.left
But that doesn't seem to return any values.
What am I doing wrong guys? Or should I just take a whole different strategy to fixing this problem?
Edit: I've now changed horizonMenu to a class. Alas, my problem seems to persist :(