0
Good evening, I have this code that works one part and the other part does not.
$(document).on('scroll', function() {
/* funciona */
var max_opacity_arrow = 0.3;
var min_opacity_arrow = 0.1;
var opacity_arrow = max_opacity_arrow * (1 - $(this).scrollTop() / $(window).height());
if (opacity_arrow > min_opacity_arrow) {
opacity_arrow = opacity_arrow;
} else {
opacity_arrow = min_opacity_arrow; }
$('div.home.show div.bottom.arrow').css('opacity', opacity_arrow);
/* não funciona */
var max_pespective_rotatex = 0;
var min_pespective_rotatex = 90;
var rotateX = max_pespective_rotatex * (1 - $(this).scrollTop() / $(window).height());
if (rotateX > min_pespective_rotatex) {
rotateX = rotateX;
} else {
rotateX = min_pespective_rotatex; }
$('div.primeirapagina div.mainpespective').css('transform', rotateX + 'deg'); });
The bottom part in question is a copy of the top, but only when I use the TRANSFORM that does not work, if I change there at the end . css('Transform' the Transform for anything else, it works but if I return the Transform, it doesn’t work, what I want is that just like when I roll the page the Arrow goes missing, I want a div to go around until I’m facing the other way or 0 how could I do it any other way that works? grateful in advance.
works, really a misconception, I did not notice that lacked the totatex(), grateful, but then you gave birth to my one more mistake, it does not stop, keeps rotating the whole life, it stops at 0 but does not stop at 90
– flourigh