javascript dual sliding panel responsive

How we can create a dual sliding panel using HTML CSS JavaScript? Solution: Check out this JavaScript Dual Sliding Panel With CSS, Responsive Panel Slide.

Previously I have shared many types of sliders, But this is a dual sliding panel which expands on click. Panel slider basically is an element which slides on click and shows the hidden content inside its. Basically, This type of panel can be used in multiple places like on review log, showing quotes, etc.

Today you will learn to create Responsive Panel Slide with dual panel. Basically, there are two panels with 50% of the screen width and you can see only a title in each panel, but when you will click on the panel it will expand by 100% and you will see a quote and a background image. There are also two arrow buttons you can see, one is left arrow and other is right.

So, Today I am sharing JavaScript Dual Sliding Panel With CSS. There is a toggle feature you can open the panel on click and also can close the panel on another click. Also, this is a responsive design, the panel becomes top to bottom aligns on small screen size devices. This program will be very informative and useful for you.

If you are thinking now how the panels actually are, then see the preview given below.

Preview Of Responsive Panel Slide

See this video preview to getting an idea of how the dual panel looks like.

Live Demo

Now you can see this visually, you also can see it live by pressing the button above. If you like this, then get the source code of its.

You May Also Like:

JavaScript Dual Sliding Panel With CSS Source Code

Before sharing source code, let’s talk about it. First I have created all the divs and elements using HTML, on each panel, there has a heading, arrow button, quote, and an image. I have used SVG for creating the two arrow buttons, there I have not used any icon library. Also, I have used some tags between the divs like article tag, and section tag.

Now using CSS I have placed all the elements on the right place. Basically, there are two panels with 50% width first you can see only the heading and arrow. Using CSS I have hides the quote and image section firstly, you can see it after clicking then it will expand to single on 100% width. There is also a hover effect, when you will hover on any panel then its arrow icon starts moving.

For the responsive design, I have changed the position of the panels. On a desktop, the panel is placed as one in left and one in right but on a small screen, its becomes one in the top and another in the bottom. And when you will click on the panel to expand in small screen it will cover 100% of the height of the screen.

In there JavaScript handling the toggle feature. First JS fetches the panels using document.querySelector (info) and stored in variables. Now its read the click action and if the left panel has been clicked then its hide the right and expand the left panel. Left all other things you will understand after getting the codes, I can’t explain all in writing.

For Creating this program, you have to create 3 files. First for HTML, second for CSS, and third for JavaScript. Follow the steps to creating this without any error.

index.html

Create an HTML file named ‘index.html‘ and put these codes given below.

style.css

Now create a CSS file named ‘style.css‘ and put these codes given here.

function.js

The final step, Create a JavaScript file named ‘function.js‘ and put the codes.

That’s It. Now you have successfully created JavaScript Dual Sliding Panel With CSS, Responsive Panel Slide. If you have any doubt or question comment down below.

Thanks For Visiting, Keep Visiting.

LEAVE A REPLY

Please enter your comment!
Please enter your name here