"value" is not an attribute for <img> elements
Try this
Code:
$(document).ready(function() {
$('.not_selected').click(function() {
// extract the number from the src of the image
var theNum = this.src.match(/\d/)[1];
// hide all the divs in white_section first
$('.white_section div').hide();
// show only the one with the correct number
$('#white_content_' + theNum).show();
// add a new "fixed" class to the current element that cannot be removed on mouseleave
// remove this class from all other <img> first
$('.not_selected').removeClass('fixed');
$(this).addClass('fixed');
});
$('.not_selected').hover(function() {
$(this).addClass('selected');
}, function() {
$(this).removeClass('selected');
});
});
You would need to introduce a new .fixed class that cannot be removed on mouseleave and that should have the same style as .selected (just add another class selector to the same CSS rule)