EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: glarsen on May 28, 2014, 02:03:40 PM



Title: Keeping dynamic window inside panel
Post by: glarsen on May 28, 2014, 02:03:40 PM
Can you help with my JQuery syntax:

      onMove: function(left, top) {
        if (left < 0) $(this).window.left = 0;
        if (top < 0) $(this).window.top = 0;
      }


$(this) has the correct window div.  Firebug says window.left is undefined.

Thanks


Title: Re: Keeping dynamic window inside panel
Post by: stworthy on May 29, 2014, 12:36:52 AM
Please try this:
Code:
$('#w').window({
onMove:function(left,top){
if (left < 0 || top < 0){
$(this).window('move',{
left: (left<0 ? 0 : undefined),
top: (top<0 ? 0 : undefined)
})
}
}
})


Title: Re: Keeping dynamic window inside panel
Post by: glarsen on May 29, 2014, 05:11:16 AM
Thanks!