Forums

The forums ran from 2008-2020 and are now closed and viewable here as an archive.

Home Forums CSS [Solved] 2 DIVs and on mouse effect while on the other one

  • This topic is empty.
Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #203676
    mmirzynski
    Participant

    Hi guys hope that it will be fast one :)
    My website is divided by two divs one on the left side, and one on the right. On website load both divs should be colorful and etc but while mouse is over the one on right, then the other one should fade or gone black and white. How can i achieve that effect?
    Greetings from Poland ;)
    btw not sure if in CSS or JS

    #203679
    Paulie_D
    Member

    What have you tried so far?

    #203719
    mmirzynski
    Participant

    Not much. I had no idea how to start because of mouse effects on other div then the mouse is over on :D I can describe it in simplier language maybe someone better at jquery (think that CSS will be no help there :( ) could translate it in java script? :D

    2 divs- one called left, other called right

    left div on mouse over makes right fading b&w or (fadin alpha whateva)
    right div on mouse over makes same thing but with left div.
    Anyone? :)

    #203815
    JustinF
    Participant

    Does this work for you? It’s simple to select elements with the ~ general sibling combinator, but it’s impossible to select previous siblings with CSS only, hence the need for a little jquery for that.

    http://codepen.io/jmaker/pen/RPZZEX

    #203827
    mmirzynski
    Participant

    Yeaaah that’s it thank you so much, you are my hero :)

    #203847
    gcyrillus
    Participant

    hello,

    !? why JavaScript when you can do without ?

    http://codepen.io/gc-nomade/pen/dozKaG

    #203866
    JustinF
    Participant

    lol nice. I was just over-thinking it. Yeah that works much better.

Viewing 7 posts - 1 through 7 (of 7 total)
  • The forum ‘CSS’ is closed to new topics and replies.