Change ul style when arriving to div(scrolling)

后端 未结 6 1500
-上瘾入骨i
-上瘾入骨i 2020-12-18 17:24

I would like to change a ul style on scrolling and arrive to div using jQuery, explanation down.

CSS:

#menu {
    background-color:#ccc;
    position         


        
6条回答
  •  遥遥无期
    2020-12-18 18:05

    You can use YAHOOs YUI framework to write a javascript along the lines of something like this:

    var Event = YAHOO.util.Event;
    
    Event.on(window, 'scroll', function() {
    
        if (document.getElementById("DIV1").scrollTop == 0) {
            document.getElementById("DIV1").className = "menutext2";
        }
    }
    

提交回复
热议问题