Hi guys! I need to make the implementation of changing the background when hovering on div. Brought diva painted in red, he removed it so red and remains, once again brought it to become blue, removed blue remains and so on. Slightly changed the search methods and found almost what I need but only the colors change randomly. Can anyone help, I'm just learning, I want to make an idea on the site) It’s necessary to set the colors manually, and not what they would randomly change. That's what happens now [Example for example] http://jsfiddle.net/marusia/ cL17z15p / 1

    1 answer 1

    Add another variable and check its value when hovering. If it is equal to 1, then we put green and set the variable to value 2. If it is equal to 2, then put red and set the variable to 3. And so on, at least 64000. You can simply use inc (), by the way, instead of assigning specific numbers.

    Update

    Issue the code on jsfiddle, if there is time - I will write an example. In general, the conversation here is simple: if you want to learn, all the doors are open and the information is sea, learn. If you want to get a result right away - pay to the one who studied instead of you. And for beginners with one question and even without answers, I don’t even want to help, you probably just want freebies.

    • Can you give a small example? where to add this variable)) - marusia
    • Issue the code on jsfiddle, if there is time - I will write an example. In general, the conversation here is simple: if you want to learn, all the doors are open and the information is sea, learn. If you want to get a result right away - pay to the one who studied instead of you. And for beginners with one question and even without answers, I don’t even want to help, you probably just want freebies. - Get
    • I'm learning. In practice, only) And if you have no desire to help, then do not, why write all sorts of freebies. - marusia
    • To learn you need to read and think, and not just ask solutions from others. Here is an example: jsfiddle.net/60sdmebu - Get
    • Thank you.) I read, really, but I have not yet reached the point. ))) - marusia