This js fiddle runs with no errors or problems:
However, when embedded within http://www.zabb.co.uk/untitled6.html it does not work? Any suggestions please?
EDIT:
Further to your comments and suggestions below a solution has been found, thank you all:
$(document).ready(function() {
$('.thumbnail2').click(function() {
src = $(this).attr('src');
if (src != $('.img').attr('src')) {
$('.img').fadeOut(250, function() {
$(this).attr('src', src).fadeIn(250);
});
}
});
});
Important bit to ensure event works is to wrap your jQuery code within:
$(document).ready(function() {
// ...
});
See following link for further information regarding this function:
Introducing $(document).ready()
Wrap your embedded script in a
$(...)or$(document).ready(...)jsfiddle did that for you (see the dropdown box on the left that says “onLoad”?).