I want to change css property value through javascript for loop

283
May 23, 2017, at 05:12 AM

I've visited Stack Overflow many times for answers and here is my first question ever: Is changing css property value through javascript for-loop possible?

Because this doesn't work:

window.addEventListener("wheel", someFunc);
function someFunc() {
   if (window.pageYOffset>600) {
      var x = document.getElementById("cpu");
      y = 0.1;
      for (var i = x.style.opacity; i < 1; i += y); 
   }
}
Answer 1

what i am trying to do with js written via jquery library:

 window.addEventListener("wheel", downScr);
 function downScr() { 
if (window.pageYOffset>600) {
 $(document).ready(function () {
     $("#gf").fadeIn(1000); 
    });
  }
} 
READ ALSO
Keyframe animation removing skew from div on animation

Keyframe animation removing skew from div on animation

I have a skew transform applied to a div and I'm wanting to animate it on page load

332
iPhone disable swiping left and right to make the page move

iPhone disable swiping left and right to make the page move

I'm gonna try my best to explain thisIf you go to target

303
How do I create a smooth transition in my menu dropdown?

How do I create a smooth transition in my menu dropdown?

I'm trying to figure out how to make a smooth transition in my menu transitionI already wrote a function for the times to appear and disappear onclick, but I'm not sure how to style the transition

214
Bootstrap - Image Align - Within a row

Bootstrap - Image Align - Within a row

Im trying to center three small thumbnails in a 12 row, I only want these three images in the row, but using center-block, responsive image, align or breaking the row into smaller segments (4, 4, 4)

254