Jump to content

just to warn, i am new to programming

 

anyway, i've been trying to implement a function that when it hovers over a div cell, the shade color darkens. eventually reaching a ceiling that makes it totally dark

 

said function

$('#Shade').on('click', function() {
	$('.cell').hover(function() {
		let dark = 90;
		$('this').css('background-color', 'hsl(0, 0%, ${dark -= 10}%');
		});
});

but it doesn't work. 

 

here's the rest of the code - just FYI it's pretty much a sketchboard 

https://codepen.io/tech125/pen/zPwaoM

Link to comment
https://linustechtips.com/topic/860238-math-inside-jquery/
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×