ajlkn / jquery.dropotron

Adds multilevel dropdown menus to jQuery.
132 stars 61 forks source link

Fix: use $(document).width() instead of $(window).width() #18

Open fverry opened 7 years ago

fverry commented 7 years ago

$(window).width() refers to the width of the device's viewport. $(document).width() refers to the width of the html content

When a browser window is reduced until the document content overflows the window, the values of $(window).width() and $(document).width() starts to diverge.

Also, on an iPhone 6, the $(window).width() is always 667, while the $(document).width() is the actual width of the HTML content. The HTML document pixels are "zoomed" to fit inside the iPhone 667 pixels (not sure what this means ?).

Tsaukpaetra commented 2 years ago

Thumbs up on this. I was wondering why certain pages had malfunctioning dropdowns...