Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have a page that scrolls sideways and I have a floating menu. I want the text in the menu to invert the color that is under it. Is there a way to do that with HTML5, Javascript, and/or jQuery?

Added: How would you invert an image when it goes over different parts of the page? CSS?

This is the bit of CSS I use for the menu

body{
  background:#000;
  font-family:Georgia;
  font-size: 34px;
  font-style: italic;
  letter-spacing:-1px;
  width:12000px;
  position:absolute;
  top:0px;
  left:0px;
  bottom:0px;
}
ul#banner{
  position: fixed;
  line-height: 45px;
  margin: 0 30px; padding: 0; 
}
See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
287 views
Welcome To Ask or Share your Answers For Others

1 Answer

step1. Get the position of your menu

step2. Remove your menu and get an element that is placed on the position

maybe you can use document.elementFromPoint

step3. Invert the element's color and apply it on your menu

step4. Show your menu again

step5. Repeat it whenever you need to change menu's color(scroll, etc.)


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...