astra
domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init
action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /home/sqrtyhjzaqx471/public_html/wp-includes/functions.php on line 6121.images {
display: flex;
align-items:center;
background-color: #eee;
padding: 1rem;
overflow-x: scroll;
}
.images > div {
flex: none;
max-width: 100%;
padding-left: 15px;
padding-right: 15px;
}
.images img {
max-width:100%;
width: 100%;
}
@media (min-width: 960px) {
.images {
overflow-x: visible;
}
.images > div {
flex-basis: 0;
flex-grow: 1;
}
}
]]>
gsap.to(".box", { xPercent: -200 });
]]>
HTML Code :
<div class="boxes2">
<div class="box2"></div>
<div class="nav">
<button id="play">play</button>
<button id="pause">pause</button>
<button id="resume">resume</button>
<button id="reverse">reverse</button>
<button id="restart">restart</button>
</div>
</div>
JS Code :
var tween = gsap.to(".box2", {
duration: 4,
x: '100vw',
rotation: 360,
ease: "none",
paused: true
});
// click handlers for controlling the tween instance...
document.querySelector("#play").onclick = () => tween.play();
document.querySelector("#pause").onclick = () => tween.pause();
document.querySelector("#resume").onclick = () => tween.resume();
document.querySelector("#reverse").onclick = () => tween.reverse();
document.querySelector("#restart").onclick = () => tween.restart();
Here is my Preview :
See the Pen GSAP Annimation
]]>