html - jquery animation won't return back when clicked -
I'm having trouble in this jquery animation.
To make it short, expanded div
here is a jsfiddle link:
Here is a sample code that I used in jquery
$ (document). (Function () {$ ("# div_menu_icon"). Click (function () {var new_size = "250"; // This is the width of the menu when var menu_icon_width = "55px"; var div_menu_open = $ ("# Div_menu "Width"); (width:) width =) width =) width ()> = new_size? Menu_icon_width: new_size; $ ('# div_menu'). Animate ({width: div_menu_open,}, {duration: 200, line: wrong}); $ ('#div_menu_icon' Animate ({width: div_menu_open}, {duration: 200, line: wrong}};});}); Please help me fix it, thanks
EDIT: Try changing the CSS of div_menu in jsfiddle, it works. But I need a border for my design, so there is a way to fix it?
#div_menu {background-color: # 34495e; Width: 100%; Height: Calc (100% - 50px); }
$ (document) .ready (function () extended {var} = ("# Div_menu") $ ('# div_menu') $ ("# div_menu_icon") Click (function () {var newWidth = expanded? Menu_icon_width: new_size; $ ('# div_menu'). {Width: newWidth} , {Duration: 200}); $ ('# div_menu_icon'). Animate ({width: newWidth}, {duration: 200}); extended =! Extended;});});
I do not know why your job is not working, I will continue to look into it as it would otherwise bug me. But, at least until now, I have simplified your argument and have brought the variable out of the suggestion of the event.
Comments
Post a Comment