The condition and operation of javascript that div is 10 px;


  • QA Engineer

    By the end of the working day, the brain offline is simple and simple as to put the following pattern in js. There's a parent div with a scrub, inside this div'a, two more div'a, one of which needs to be recorded if the parent div was engaged on 10 px.

    I only need a condition:

    if(условие)
    {
    действие
    }
    

    Thank you so much for your help.



  • this.onmousewheel = function(){
      if(this.scrollTop >=10px){
        this.children(div1).style.position = 'fixed';
      }
    }
    

    Something like that. It's a pseudocod as close as JS. If you need to, I'll write to JS. By the way, clean or jquery?


Log in to reply
 


Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2