0

I want to slide down some Divs in WordPress using jQuery slide down. but all item come over each other. here is my code:

$(".more-button").click(function(){
  $("#feature-column").slideDown();
  slideFadeOut($('.more-button'));
});

$(".less-button").click(function(){
  $( "#feature-column" ).slideUp(2000);
  slideFadeIn($('.more-button'));
}); 
})

and div is some thing like this:

<div class="more-button"> show more </div>
    <div id="feature-column">
    <div>123</div>
    <div>123</div>
<div class="less-button"> show less</div>

    </div>

image of wrong slide down

image of correct slide down

7
  • Could you please link us to a real webpage? it's quite difficult to tell what's the problem. We would need to see the HTML structure + the CSS involved. Just basing the answer on your code i would say you might have a problem with id's. Since you are attaching the event to ALL the divs that have class .more-button or .less-button and you always go hit #feature-column (which being an ID should be UNIQUE)
    – Diego
    Commented Jun 10, 2021 at 8:07
  • @Diego datamoon.ir/jsj
    – sara a
    Commented Jun 10, 2021 at 10:38
  • Ok, and what is exactly the desidered effect?
    – Diego
    Commented Jun 10, 2021 at 10:42
  • I want to slide down some icons but they shown wrongly as you can see in the image i attach
    – sara a
    Commented Jun 10, 2021 at 10:44
  • they should come below each other not on each other
    – sara a
    Commented Jun 10, 2021 at 10:45

0

Browse other questions tagged or ask your own question.