2

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

4

1 回答 1

1

可能需要一些调整,但这有效:

$("#rightpanel3").on("panelopen", function() {
    $(".buttons.right").animate({ marginRight: $("#rightpanel3").width() });
});

$("#rightpanel3").on("panelclose", function() {
    $(".buttons.right").animate({ marginRight: -($("#rightpanel3").width()) });
});

http://jsfiddle.net/yRu4q/

这些事件记录在这里

于 2013-04-19T18:27:31.113 回答