EasyUI Forum
April 29, 2024, 08:56:31 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: get dialog width and height when resize  (Read 5629 times)
Alfred
Full Member
***
Posts: 134


-Licensed User-


View Profile
« on: November 11, 2019, 12:37:35 PM »

Is it possible to get the dialog width and height as we resize.


Code:
var d = $('#infp');//dialog selector
d.dialog('onResize',function(w,h){
   var newheight = h;
   var newwidth = w;
})

This does not work. This code is inside the dialog, which content is loaded remotely.

Thanks and regards,
Alfred
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: November 11, 2019, 07:18:47 PM »

Call 'options' method to retrieve the dialog's width and height.
Code:
var opts = $('#infp').dialog('options');
console.log(opts.width+":"+opts.height);
Logged
Alfred
Full Member
***
Posts: 134


-Licensed User-


View Profile
« Reply #2 on: November 12, 2019, 09:00:16 AM »

Thanks. This works fine

Code:
var dial = $('#infp');
dial.dialog('options').onResize = function(w,h){
//
}
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!