简体   繁体   中英

Jquery UI “drop” effect - background move

I'm trying to do a simple JQuery UI module that shows a menu from left to right with "drop" effect.

I'm using Jquery UI 1.10.3 and Jquery 2.0.3.

My problem: If menu comes from left the menu background jumps from bottom to top and viceversa.

This is my code, you can check my problem here: http://jsfiddle.net/yrhTS/

> First JavaScript function made an alternative to JQuery deprecated .toggle().

Thank you very much in advance!

Add padding:2px; to your #articleleftmenu will solve your problem.

Check this JSFiddle

FYI:

There is a difference between .toggle() and .toggle() event

See documentation:

  1. .toggle()
  2. .toggle() event

So you use .toggle() normally as below.

$('.sections').on('click', function() {
           $( "#articleleftmenu" ).slideToggle( "left" );
}); 

Check this Updated JSFiddle .

Hope you understand.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM