简体   繁体   中英

Text colour variable to background colour

I've got sections of the site with dark coloured imagery and then other panels of white. In a fixed position in the top left hand corner are some simple navigation dots that the user can click on to move through the site. However, of course these dots become invisible when scrolling over white backgrounds.

Link to the dev site is here: http://dev.matthewbugeja.com/

My question is: is it possible to have those dotes change to black when on white areas of the site and then revert back to white when on darker areas? Thanks in advance for any answers.

you can make color changes to the dots by checking the window scroll value for eg check below code

$(window).scroll(function () {
    if ($(window).scrollTop() > 500) {

        $("#nav ul li a").css("color", "#000000");

    } 
})

Note that value 500 is an example here you may have different scroll value checks.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM