# Need help creating sliders

**URL:** <https://forum.pinegrow.com/t/need-help-creating-sliders/4577>\
**Category:** General\
**Created:** [October 3, 2020, 5:04am UTC](https://forum.pinegrow.com/t/need-help-creating-sliders/4577 "2020-10-03T05:04:13Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![randyrie](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/randyrie/32/2103_2.png) [@randyrie](https://forum.pinegrow.com/u/randyrie)\
**Post date:** [October 3, 2020, 5:04am UTC](https://forum.pinegrow.com/t/need-help-creating-sliders/4577/1 "2020-10-03T05:04:13Z")

</div>

Guys…  
I’ve been trying to create “sliders” that will drop down columns similar to a slide-out that I have on my webpage. Please visit the development site at: [https://www.rjrwebz.com/universe/](https://www.rjrwebz.com/universe/) and review my attached drawing.

As always, any suggestions, guidance, help, gentle nudges are welcome.

 ![sliders](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/9/99ccf99c06440895ce2ae2af0dfb376c8252c62a.jpeg)

---

<div class="post-metadata">

**Author:** ![RobM](https://avatars.discourse-cdn.com/v4/letter/r/278dde/32.png) [@RobM](https://forum.pinegrow.com/u/RobM)\
**Post date:** [October 3, 2020, 12:16pm UTC](https://forum.pinegrow.com/t/need-help-creating-sliders/4577/2 "2020-10-03T12:16:04Z")

</div>

THere are a multitude of ways that you could attack this. I’m sure some people on this forum could come up with some really elegant CSS only solutions, or use some aspect of Bootstrap, but I tend to think in terms of JavaScript and JQuery, so…

I would create an HTML structure with each of your three dropdowns within a column, containing a div with your content to be revealed inside, and then your tabs.

 ![image](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/4/46c137ad100d77af7bdc617f9db373123e85bb15.png)  
In this case I just used buttons as the tabs to mock it up quickly.  
Then, for basic functionality, add a `display: none;` to each div with a class of ‘content’.  
Next, each div should get a unique ID - I’ve used ‘one’, ‘two’, and ‘three’.  
Next give each tab (in this case button) an attribute corresponding to the ID of the section of content that you want to open, for example, the first one would be: `data-target='#one'` and also give each a class of ‘drop-tab’.  
Now add a script to your page in whatever way you feel comfortable - either load in a separate file, or include on page between tags. Make sure to add after you load JQuery.

```auto
$(document).ready(function(){
  $(".drop-tab").on('click',function(e){
    e.preventDefault();
      let theId = $(this).attr("data-target");
      console.log(theId)
    
    //Check this block is open or not..
    if(!$(this).prev().hasClass("open")) {
      $(theId).slideDown(400);
      $(theId).addClass("open");
    }
    
    else if($(this).prev().hasClass("open")) {
      $(theId).removeClass("open");
      $(theId).slideUp(400)
    }
  });
});

```

You will have to work out the styling. Good luck!

---

<div class="post-metadata">

**Author:** ![randyrie](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/randyrie/32/2103_2.png) [@randyrie](https://forum.pinegrow.com/u/randyrie)\
**Post date:** [October 3, 2020, 6:01pm UTC](https://forum.pinegrow.com/t/need-help-creating-sliders/4577/3 "2020-10-03T18:01:33Z")

</div>

Thanks @RobM for your fast response… I’m not familiar with jQuery but I’ll give what you sent a try and see if I can get it to work.

I was hoping that the slideout I already have could be modified to be a slidedown rather than a slideout but beggars shouldn’t be choosers, I guess.

I’m attaching a screen shot of the CSS I use to run the slideout and hope someone can give me ideas how to modify it to run the desired slidedowns.

 ![CSS for slideout](https://canada1.discourse-cdn.com/flex036/uploads/pinegrow/original/2X/0/0d96029cc567132037772421f9139ef4df2eb4ac.png)

---

<div class="post-metadata">

**Author:** ![droidgoo](https://yyz2.discourse-cdn.com/flex036/user_avatar/forum.pinegrow.com/droidgoo/32/2209_2.png) [@droidgoo](https://forum.pinegrow.com/u/droidgoo)\
**Post date:** [October 3, 2020, 9:03pm UTC](https://forum.pinegrow.com/t/need-help-creating-sliders/4577/4 "2020-10-03T21:03:02Z")

</div>

you can do that in CSS using `display: none;` for the hidden content until it’s clicked on and change it to `display: block` or grid or flex, whichever need.

to detect the mouse click you could use javascript or what’s called the “[input checkbox toggle](https://dabblet.com/gist/1506530)” and use the `:checked` status to toggle the display change.

here’s a full implementation of a menu using it, with animation included.

> **[Pure CSS Responsive Flex Menu](https://blog.christopherianmurphy.com/2016/01/responsive-pure-css-menu/)**
>
> This resource is a responsive menu based on CSS using flexbox. It relies upon a checkbox input to toggle between states and can therefore be used as an alternative to JavaScript-based solutions.
