简体   繁体   中英

when the popup closes I need to add a scroll to the red background div

  1. When I click open first window button a popup opens.
  2. In that window when I click the cross icon the popup closes.
  3. When the popup closes I need to add a scroll to the red background div.

Can you guys tell me how to add it? Providing my code below.

http://jsfiddle.net/7n77r6ue/

$("#open1").click(function() {
    $("#win1").show().kendoWindow({
        width: "300px",
        height: "500px",
        modal: true,
        title: "Window 1"
    });
});

$("#open2").click(function() {
    $("#win2").show().kendoWindow({
        width: "300px",
        height: "500px",
        modal: true,
        title: "Window 2"
    }).data("kendoWindow").center();
});

$("#close2").click(function() {
    $("#win2").data("kendoWindow").close();
});

You can add a function on close event of the window, simply by putting it into the options:

$("#win1").show().kendoWindow({
    width: "300px",
    height: "500px",
    modal: true,
    title: "Window 1",
    close: functionOnClose     // Call a function on close of the window
});

To add a scrollbar, you can use jQuery:

$(".scrollWindow").css("overflow-y","scroll");

(The scrollbar will be inactive, except if the div is higher than the viewport, but it will appear.)

Here's a demo: http://jsfiddle.net/wrvj1p44/

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM