Samhats
Samhats

Reputation: 13

Would like jQuery Mobile panel Open by default

Is there a way of altering the default state of a JQuery Mobile panel to be open when the page loads?

Currently using jQuery Mobile 1.4.1 and can't find anything in the documentation and searched every where I can think online.

Upvotes: 1

Views: 1939

Answers (1)

ltalhouarne
ltalhouarne

Reputation: 4636

You can try the following:

$(document).on('pagebeforeshow', '#index', function(){       
    $( "#mypanel" ).panel( "open");
});

With "index" and "mypanel" being respectively the ids of your page and your panel.

Upvotes: 1

Related Questions