See example here: http://jsfiddle.net/mzhang23/CGfzq/9/
I am using the following code to try and allow a click on the blue shirt thumbnail image in the rightmost column to show the blue shirt image divs in the first and second column. (To test this, click the “x” on the blue shirt in the middle column to hide it first)
I’ve used an HTML 5 data-eltype descriptor for the third column image of the blue shirt and hope to use that descriptor to find the relevant class for the .show() function.
<script type="text/javascript">
$(document).ready(function(){
$('.thumbslist .element').click(function(){
$('.outfit-box').find('.' + $(this).data('eltype')).show(250);
});
});
</script>
Any ideas why it’s not working?
For jQuery 1.4.2, what you want is to get the attribute data-eltype see: http://jsfiddle.net/CGfzq/10/
edit
As @mu is too short points out, the method you tried will only work in more recent versions.