EasyUI Forum
May 17, 2024, 07:42:23 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Keeping dynamic window inside panel  (Read 7556 times)
glarsen
Newbie
*
Posts: 39


View Profile Email
« 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
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 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)
})
}
}
})
Logged
glarsen
Newbie
*
Posts: 39


View Profile Email
« Reply #2 on: May 29, 2014, 05:11:16 AM »

Thanks!
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!