EasyUI Forum
April 23, 2024, 12:27:42 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: [SOLVED] $.fn.panel.defaults override  (Read 5083 times)
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« on: July 26, 2017, 08:03:22 AM »

Hello
I try to override panel defaults:
Code:
$.extend($.fn.panel.defaults, {
  openDuration: 200,
  closeDuration: 200
});
but it does not work - how to override it, please?
Thank you.
« Last Edit: July 27, 2017, 01:22:58 AM by Pierre » Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #1 on: July 26, 2017, 05:26:03 PM »

No problem, this code does override the default panel properties.
Code:
<script>
$.extend($.fn.panel.defaults, {
  openDuration: 200,
  closeDuration: 200
});
</script>
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #2 on: July 26, 2017, 10:51:39 PM »

Thank you but it does not work for me.
Please check example here:
http://code.reloado.com/oeasyrik1/129/edit#preview
Thank you
Logged
jarry
Administrator
Hero Member
*****
Posts: 2262


View Profile Email
« Reply #3 on: July 27, 2017, 12:46:05 AM »

The 'openDuration' and 'closeDuration' properties are only valid when setting the 'openAnimation' and 'closeAnimation'. In your case, you used the native 'animate' method to slide your panel. You can set the 'duration' property when calling this 'animate' method.
Code:
$('#p').panel('panel').animate({right:0},100);  // show
$('#p').panel('panel').animate({right:-$(window).width()/2},100);  // hide

The updated example is available from http://code.reloado.com/oeasyrik1/130/edit#preview
Logged
Pierre
Sr. Member
****
Posts: 439


View Profile Email
« Reply #4 on: July 27, 2017, 01:22:43 AM »

Awesome, thank you so much  Grin
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!