Depending on what you actually want your class
es to be, I'd use this code:
$(".thumbnail").on("click", function () {
var $block = $(this).closest(".block");
$block.find(".window, .video").add("#modal").removeClass("hide").addClass("show");
});
DEMO: http://jsfiddle.net/gLMSF/ (using different, yet similar code)
It actually finds the right elements, based on the clicked .thumbnail
. It finds its containing .block
element, then looks at its descendants to find the .window
and .video
elements.
If you actually want to include .
in your attributes, you need to escape them for jQuery selection.
As for styling, you should probably just have the styling be display: block;
by default, and then toggle the hide
class. It's less work, and makes more sense logically.