Reputation: 363
So i have a menu(only icons) that is on the right side of my screen and I am wanting to get the icons to slide out with my panel when the panel opens. but i want the menu to be visible when the panel is closed. One image will open one panel and another image will open another panel.
<div class="buttons right">
<a href="#rightpanel3" data-role="button" data-inline="true" class="filter">One</a>
<a href="#rightpanel1" data-role="button" data-inline="true" class="layers">Two</a>
<a href="#rightpanel2" data-role="button" data-inline="true" class="list">Three</a>
<a href="#rightpanel4" data-role="button" data-inline="true" class="settings">four</a>
</div>
<div data-role="panel" id="rightpanel3" data-position="right"
data-display="overlay" data-dismissible="false" data-theme="b">
<h3>Search/Filter</h3>
<h4 class="top heading">Search</h4>
<h4 class="heading">Filter</h4>
</div>
jsfiddle: jsfiddle.net/5GhPM
Upvotes: 2
Views: 1248
Reputation: 76199
May need some tweaking, but this works:
$("#rightpanel3").on("panelopen", function() {
$(".buttons.right").animate({ marginRight: $("#rightpanel3").width() });
});
$("#rightpanel3").on("panelclose", function() {
$(".buttons.right").animate({ marginRight: -($("#rightpanel3").width()) });
});
The events are documented here.
Upvotes: 1