w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
Toogle maximize width and height div using jquery

Have you given jQuerys Toggle a try? I've tried the same thing you are many times, the class swapping just is not worth it, as a personal opinion, so i've ended using the toggle or an if -statement. For example:

maximized = 500px
if($(".target").height() != maxmized){
   // maximize it
} else {
   // minimize it

Also, without knowing how it all looks or goes, you might want to take into consideration the animation times, if you are clicking too fast or slow, the action might not kick in, so using a callback would be good.

© Copyright 2018 w3hello.com Publishing Limited. All rights reserved.