Skip to content
This repository was archived by the owner on Oct 8, 2021. It is now read-only.
This repository was archived by the owner on Oct 8, 2021. It is now read-only.

Make panel and page content scroll independently #5493

Closed
@jeremydenoun

Description

@jeremydenoun

Hi,

This is a feature request and implementation proposal :

You have implemented nice panel (:+1:) but with a simple support of overflow... for obtain a Facebook Panel menu more realistic display when we openning panel, the panel and the panel content should fix to max window height, the panel content should overflow hidden and panel should overflow auto...

I try implementation proposal and it's work on Android/iOS 5-6/Web

$(document).bind('panelbeforeclose', function(e, data) {
    $(".ui-panel").scrollTop(0);
});

$(document).bind('panelbeforeopen', function(e, data) {
    top_pos = $(document).scrollTop();
    $(".ui-panel").css("top", top_pos);
});

$(document).bind('panelopen', function(e, data) {
    top_pos = $(document).scrollTop();

    if ((iOS && iOS <= 5.01)) {
        $(".ui-panel").css("overflow", "scroll");
        $(".ui-panel").css("-webkit-overflow-scrolling", "auto");
    } else {
        $(".ui-panel").css("overflow", "scroll");
        $(".ui-panel").css("-webkit-overflow-scrolling", "touch");
    }
    $(".ui-panel").height($(window).height() - $('.ui-page-active header').height());
    $(".ui-panel").css("top", 0);
    $(".ui-panel-content-wrap-open").css("overflow", "hidden");
    $(".ui-panel-content-wrap-open").height($(window).height() - $('.ui-page-active header').height());
    $(".ui-panel-content-wrap-open").scrollTop(top_pos);
    $(document).scrollTop(0);
});

$(document).bind('panelclose', function(e, data) {
    top_pos = $(".ui-panel-content-wrap-closed").scrollTop();
    $(".ui-panel").height('auto');
    $(".ui-panel-content-wrap-closed").height("auto");
    $(".ui-panel-content-wrap-closed").css("overflow", "auto");
    $(document).scrollTop(top_pos);
});

improvement possible :

  • Header toolbar fixed effect
  • Support Fixed Footer
  • add swipe gesture support (opening and closing)
  • support a global panel (without needed to add to each page)

Best

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions