简体   繁体   中英

jQuery: toggle div but height is adjusted at the end of loading

I use this script to toggle a div with jQuery:

$('.toggle').click(function() {
    var $toggled = $(this).attr('href');

$($toggled).siblings('.gallery:visible').hide();
    $($toggled).toggle("slide", {direction: 'up'}, 750);
    return false;
});

The problem is that during the animation, the appearing div is cut at the end. But the proper height is restored at the end of the animation.

Here's the link to the "demo" (the gallery at the bottom, click on a random picture): http://www.rendezvousroma.it/new/privati.php

I don't know what's the problem.. I increased the height of all containers with no luck..

It looks like slide and .ui-effects-wrapper has some issues with elements containing margins. You can try adding css to set an explicit height to the wrapper div:

.ui-effects-wrapper {height:100% !important}

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