I am experiencing difficulty getting my ScrollMagic project to behave with using media queries. When I remove the .setPin from the Scene, the queries work perfectly and my elements sit exactly where they should. However, when I turn it back on, the html will not adhere to the media query rules as set out. It will only remember the ORIGINAL "left" attribute that existed when the page rendered.
The HTML looks like this:
<section class="container-fluid purple" id="scene02">
<img src="img/contact-us-btn.png" class="yellow-btn" data-section="#scene07">
<div class="container scene">
<ul class="tabs activetabs">
<li class="active"><img src="img/icons/section-02-1.png">
<p>Security</p>
</li>
<li><img src="img/icons/section-02-2.png">
<p>Collaboration</p>
</li>
<li><img src="img/icons/section-02-3.png">
<p>Connectivity</p>
</li>
</ul>
</div>
</section>
The scrollmagic JS looks like this:
// -------------------
// SCENE 02
// -------------------
var scene02_TL = new TimelineLite();
scene02_TL.to("#scene02 .tabs img", 1, {scale:0.6, ease: Linear.easeNone});
scene02_TL.to("#scene02 .tabs p", 1, {scale:1.4, ease: Linear.easeNone});
// build scene
scene_02_main = new ScrollMagic.Scene({triggerElement: "#scene02", duration: 560,offset:800})
.setTween(scene02_TL)
.setPin("#scene02 .tabs")
.addIndicators({name: "02_1 (duration: 560)"}) // add indicators (requires plugin)
.addTo(controller);
And finally, the LESS that outputs the css looks like this:
.tabs {
z-index: 17;
@media screen and (min-width:1200px) {
.setPosition(@scene-02-starty, 220px, 722px);
.setDimensions(900px, auto);
}
@media screen and (min-width:993px) and (max-width:1199px) {
.setPosition(@scene-02-starty, 200px, 722px);
.setDimensions(770px, auto);
}
@media screen and (max-width:992px) {
.setPosition(@scene-02-starty, 40px , 722px);
.setDimensions(676px, auto);
}
}
As you can see I have even hard coded the break-points and have checked in inspector, they all fire at the correct places. I have also tried various forms of resets and refreshes..
scene_02_main.refresh();
controller.updateScene([scene_02_main]);
controller.update(true);
Any advice would be greatly appreciated.