0

On this JQM GitHub page, someone asks about keeping two panels open simultaneously. Whenever this question is asked on the web, the usual answer is that this is basically impossible with JQM and is generally not desirable anyway, and here is no exception. But then the same developer who said this mentions:

You might want to take a look at how we've done the same for our demos. The menu at the left is a panel, but we made its content always visible at wider screens with some custom CSS. At the right we have an overlay panel for search.

I've looked all around that page. The side menu is indeed a menu and it seemingly can't be closed. I entered

$(".jqm-navmenu-panel").panel("close");

in the Chrome console and it had no effect but to return an unchanged element in the concole, whereas opening the search panel and then doing the same command with "search" in place of "navmenu" will visibly close the search panel.

I can't figure out what was done to make it this way. I'd like to duplicate the same effect on my project: Two panels being uncloseable if the screen is wide (effectively just sidebars), but behave normally on smaller screens.

For what it's worth, the documentation on panels lists a method to open two panels programatically, but I couldn't get it to work and the same developer who wrote the above has also said the JQM CSS doesn't support this and the method should be removed from the documentation.

Lenoxus
  • 545
  • 1
  • 4
  • 19
  • 1
    Use the source, Luke. Specifically lines 324 (for the media query) and 356 onwards (for the actual styling) in http://view.jquerymobile.com/master/demos/_assets/css/jqm-demos.css. – Frédéric Hamidi Jun 04 '15 at 20:15
  • That worked! Thanks. Getting the change to happen at the level of scripting rather than @media styling might take effort, but this is the right direction at least. – Lenoxus Jun 05 '15 at 15:32

0 Answers0