kissyteam / kissy

A Powerful Collection Of Modules
http://docs.kissyui.com
2.7k stars 863 forks source link

overlay: does not change position when relative to node #190

Closed yiminghe closed 12 years ago

yiminghe commented 12 years ago

KISSY Version :

1.2.0

Browsers :

all

What steps will reproduce the problem?

<button id="show">show</button>
<button id="hide">hide</button>
<div id="wrap" style="position: relative;z-index: 0;
overflow: scroll;
height: 500px;border: 1px solid red;">
    <div style="height: 1000px;">

    </div>

</div>
    KISSY.use("overlay", function (S, Overlay) {
        var o = new Overlay.Dialog({
            headerContent:"哈哈",
            bodyContent:"嘿嘿",
            render:'#wrap',
            width:300,
            height:300
        });

        S.one("#show").on("click",function(){
            o.center('#wrap');
            o.show();

        });

        S.one("#hide").on("click",function(){
            o.hide();
        });

    });
  1. click show
  2. click hide
  3. scroll wrap to bottom
  4. click show

    Expected

overlay shows in the middle of wrap

actual

overlay does not show

yiminghe commented 12 years ago

http://docs.kissyui.com/kissy/src/overlay/demo/relative_align/align.html