Hacker Newsnew | past | comments | ask | show | jobs | submit | more hellyeahdude's commentslogin

Can you direct us to some JavaScript that does this? This style of implementation is used by Dan Cedarholm and Jason Santa Maria. I think they would confirm it's best used in CSS. Haha


It's trivially implemented in something like Jquery. Just give related elements the same class name.

    $('.someClass-xx')
	.mouseover(function () {
			$('.someClass-xx').each(function () {/* Do Stuff */})
	
	})
	.mouseout(function () {
			$('.someClass-xx').each(function () {/* Do Stuff */})
	
	})


I only say it's better to implement in js because css forces you to tie behavior to markup in this case. Good implementation separates content/markup (html), presentation (css), and behavior (js).


Wow thats great! Thanks for that! Great code!


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: