Ich habe einen Hintergrund Body Slider erstellt, der Körper Hintergründe mit "nächsten" und "zurück" Schaltflächen wechseln wird. Live-Beispiel hier:Hinzufügen von Fade zu meinem Körper Hintergrund Slider
https://ts564737-container.zoeysite.com/lookbook
Diese Funktion perfekt (ignorieren die großen Bilder so dass es langsam laden), aber ich kann nicht einen Übergangseffekt wie auf dieser Website hinzuzufügen scheinen:
http://northamerica.triangl.com/pages/lookbook-swimwear
Ich habe dies mit CSS transition: all 0.5s ease-out
versucht, aber der Übergang ist schlecht und schrecklich geladen.
Könnte jemand bitte beraten, wo ich eine Überblendung hinzufügen kann, so dass es wie die obige Website ist? Danke für deine Hilfe und Zeit.
HTML & jQuery usw.
<!-- Remove header from lookbook page only and add background1 -->
<script>
jQuery(document).ready(function() {
if (top.location.pathname === '/lookbook')
{
jQuery("#root-header-cp-41e961ff2cbb3d4e6ae72927272f2db5").addClass("removeheader");
jQuery("body").addClass("background1");
}
});
</script>
<!-- Change background -->
<script>
jQuery(document).ready(function() {
var current = 1; // current background index
var max_backgrounds = 3; // number of backgrounds it will work with any number
jQuery(".next").click(function() {
jQuery("body").removeClass("background" + current);
// next background index or first one if it's the last one
current++;
if (current > max_backgrounds) {
current = 1;
}
// change background to background1, background2 ...
jQuery("body").addClass("background" + current);
});
jQuery(".back").click(function() {
jQuery("body").removeClass("background" + current);
// previous background index or last one if current is the first one
current--;
if (current < 1) {
current = max_backgrounds
}
// change background to background1, background2 ...
jQuery("body").addClass("background" + current);
});
});
</script>
<!-- Container plus images -->
<div id="toggle" width="100%">
<img src="/media/import/icons/back.png" class="back">
<img src="/media/import/icons/next.png" class="next">
</div>
CSS
/* Body background options */
.background1 {
background: url('/media/import/backgrounds/background1.jpg') no-repeat center center fixed;
background-size: cover;
overflow: hidden;
}
.background2 {
background: url('/media/import/backgrounds/background2.jpg') no-repeat center center fixed;
background-size: cover;
overflow: hidden;
}
.background3 {
background: url('/media/import/backgrounds/background3.jpg') no-repeat center center fixed;
background-size: cover;
overflow: hidden;
}
/* Toggle Buttons */
#toggle .next {
float: right;
margin-right: 20px !important;
}
#toggle .back {
margin-left: 20px !important;
}
#toggle img {
margin-top: 400px;
display: inline;
}
#toggle img:hover {
cursor: pointer;
opacity: 0.8;
}
Vielen Dank für Ihre Hilfe :) –