user7030651
user7030651

Reputation:

Scss : different background on hover on different div

I have a div with different images having different backgrounds. When I hover on it I should get the background color of respective image background. i.e. If there is black background in the image then I should get the overlay_div background as black , if there is blue then I should get blue background overlay_div.

I am using scss to maintain the variable but I don't know how can I achieve?

Here is JSFiddle

Any help would be great.

Upvotes: 0

Views: 56

Answers (1)

Ruby
Ruby

Reputation: 2959

If I understood right, then you want to get the dominant color of the image and set it to the overlay_div, then, in this case, I recommend this plugin ...

Colorify.js

But if you just going to have solid color images as background-image, then you just remove the $black_bg_color; altogether from the overlay_div

Upvotes: 1

Related Questions