I have a main panel hided at first, and sliding when the web runs. It has this style:
.contentPanel {
top: calc(40% - 1px);
height: 50%;
padding:10px;
font-size:1.2em;
overflow-y: scroll;
overflow-x: hidden;
left: 20%;
width: 75%;
}
.contentPanel{
transition: transform 5000ms cubic-bezier(0.095, 0.725, 0.020, 1.005);
}
When the website runs, jQuery calculates window's width and hides it translating X out of the window:
$('.contentPanel').css('left',window.innerWidth+"px");
And, theorically, CSS should bring it to it's correct position by adding the class .expanded:
$('.contentPanel').addClass('expanded');
Which takes it to it's 0% translate X position:
.expanded {
transform: translate(0%);
}
Problem: CSS makes just nothing because jQuery styles .contentPanel on its HTML tag, like this:
<div class="contentPanel expanded" style="left: 1366px;">
And even thow a translateX(0%) is being added, nothing moves due to the fact that X px are given on HTML's opening tag atribute.