I am making a website in which I have multiple pages. I want them not be a different webpage but to be a different div on the same page. Then I have two left and right buttons on which it, when a user clicks a particular div, should slide left or right according to the arrow. How can I do this with jQuery, HTML, CSS?
My Divs:
<div id="main-page">
</div>
<div id="about-us">
</div>
<div id="contact-us">
</div>
The Divs have a particular background-image, and their size is full-screen.
My script:
$("#main-page").click(function() {
$("#main-page").hide("slide", {direction: "left"}, 1000);
$("#about-us").show("slide", {direction: "right"}, 1000);
});
As I said, I don’t want to do like that. I want arrows to check what div has the turn to slide left or right.
HTML
CSS
JS
Demo