Currently, I am in the process of replicating a website and facing some challenges.
This site is my inspiration for the project.
I have managed to create a sliding effect using CSS, making the div slide in and out from the same direction. However, I want the pages to slide in and out similar to the model site, which I'm struggling to achieve with CSS alone. While I am proficient in HTML/CSS, my JavaScript skills are lacking. I came across this fiddle, but it only provides a toggle animation rather than the specific sliding effect I need - sliding in from the right, then out to the left while resetting at the end. Additionally, I require the current div to slide out simultaneously as the next one slides in, all within the same timeframe.
For reference, here is the Fiddle with code.
.panel{
width:0px;
height:0px;
overflow: hidden;
position:relative;
left:100%;
background: none;
z-index: 2;
-moz-transition: all .8s ease-in-out, width 0s ease 1s, border-width 0s ease 1s;
-webkit-transition: all .8s ease-in-out, width 0s ease 1s, border-width 0s ease 1s;
-o-transition: all .8s ease-in-out, width 0s ease 1s, border-width 0s ease 1s;
transition: all .8s ease;
transition-delay:0s;
margin:0px;
}
.panel:target{
width:100%;
height:auto;
margin:0px 0 0;
padding:0;
background-color: transparent;
position:relative;
left:0;
z-index:3;
}
<div id="overall-wrap">
<!-- Header with Navigation -->
<div id="header">
<a href="#home"><img class="header" src="images/logo.png" width="133" height="86" alt="Wildfire Images"></a>
<nav>
<ul id="navigation">
<li><a class="scroll" href="#home">Home</a></li>
<li><a class="scroll" href="#about">About Us</a>
<ul>
<li><a class="scroll" href="#contact">Contact Us</a></li>
</ul>
</li>
</ul>
</nav>
<div class="clearfix"></div>
</div>
<div class="clearfix"></div>
<div id="home" class="panel"></div>
<!-- About Us -->
<div id="about" class="panel">
<div class="content">
<div class="bg-about effect2">
<div class="about-wrapper">
<div class="about-text">
<h2> About Us</h2>
<p>Wildfire Images is a Sydney based boutique Portrait Photography Studio dedicated to candidly capturing all that is beautiful, fun and elegant about you and your loved ones.</p>
<p>At Wildfire Images, we tailor every shoot to you, your trade mark smile, your rapturous laugh, your devotion to those you love, the cheeky, the serious and all those gorgeous things in between that will always be unmistakably you.</p>
<p>Call us to start the story. You bring the characters and the stories and we'll take the photos that tell them.</p>
<p class="strong">Contact us today on 9150 6275.</p>
</div>
<div class="about-image"><img src="images/aboutme.jpg" width="200" height="300" alt="WildFire Studios"></div>
</div>
</div>
<!-- ... -->
</div>
<div class="clearfix"></div>
</div>
<!-- /About Us -->
<!-- Contact -->
<div id="contact" class="panel">
<div class="content">
<div class="bg-contact effect2">
<img src="images/contact-image.jpg" width="900" height="419" alt="Contact Wildfire"/>
<div id="form-wrapper">
<div id="form-outer">
<div id="text-wrap">
<div id="contact-left">
<h2>Contact</h2>
<div id="phone">
<h3>Phone</h3><p>9150 6275</p></div>
<div id="email">
<h3>Email</h3><p><a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="bcd5d2dad3fccbd5d0d8dad5ced9d5d1dddbd9cf92dfd3d192ddc9">[email protected]</a><p></div>
</div>
<div id="contact-right"><h3>Address</h3><p>Studio 18,</p><p>442-444 King Georges Rd</p><p>BEVERLY HILLS NSW 2209</p></div>
</div>
<div class="clear"></div>
<div id="form-inner">
<form name="contact" action="contact.php" method="post" onBlur="MM_validateForm('name','','R','email','','RisEmail','subject','','R','message','','R');return document.MM_returnValue">
<input name="name" type="text" class="field" id="name" placeholder="Name"/>
<input name="email" type="email" class="field" id="email" placeholder="Email"/>
<input name="subject" type="text" class="field" id="subject" placeholder="Subject" />
<textarea name="message" class="field_textarea" id="message" placeholder="Message"></textarea>
<input type="submit" value="Send" name="submit" class="submit"/>
</form>
</div>
</div>
</div>
</div>
<!-- ... -->
</div>
</div>
<!-- /Contact -->
<!-- Portraits -->
<div id="portraits" class="panel">
<div class="content">
<div class="gallery-big effect2">
<div id="gallery-big-text-wrap">
<h2>Portraits</h2>
<p>Call us to start the story. You bring the characters and the stories and we'll take the photos that tell them.</p>
<p>Contact us today on 9150 6275.</p>
</div>
<!--k gallery start-->
<img src="images/baby-06-portrait-gallery.jpg" width="798" height="531">
<img src="k/ki_galleries/all-about-me/AEP_0486.jpg" width="798" height="1200">
<img src="k/ki_galleries/all-about-me/AEP_0653.jpg" width="798" height="1200">
<img src="k/ki_galleries/all-about-me/DSC_0548.jpg" width="799" height="1200">
<img src="k/ki_galleries/all-about-me/DSC_2652-edit.jpg" width="799" height="1200">
<img src="images/family.jpg" width="798" height="532">
<img src="k/ki_galleries/all-about-me/DSC_4052.jpg" width="799" height="1200">
</div>
</div>
</div>
<!-- /Portraits -->
</div>
You can view the new site at wixwebsite.seobrasov.com
Please keep in mind that the sliding effect should seamlessly work for more than two divs, allowing smooth transitions from div 1 to div 3 without revealing div 2.