The website I am currently developing can be found at . It is built on WordPress using the Avada theme and everything seems to be functioning correctly. The image move up effect on this site is achieved with the following JavaScript:
window.onload = function() {
var size = -500;
document.getElementById("sliders-container").style.marginTop = size + "px";
};
Additionally, the CSS used for this effect is as follows:
#sliders-container{
transition: 5s;
}
However, upon testing the site in various responsive layouts, I noticed that the image moves up too much and eventually becomes invisible. My goal is to ensure that the image remains visible to some extent instead of completely disappearing. To address this issue, I attempted to adjust the JavaScript code based on window width:
window.onload = function() {
var windowWidth = $(window).width();
if(windowWidth > 768){
var size = -500;
}
document.getElementById("sliders-container").style.marginTop = size + "px";
};
Despite my efforts, this modified script did not produce the desired results. I am relatively new to JavaScript and eager to expand my knowledge in this area.