Your selector is adding the handler to a html element which does not have the class detailwhite
, Instead you need
jQuery(function ($) {
$(document).mousedown(function (e) {
document.location.href = "index.html";
e.stopPropagation();
});
$('.detailwhite').mousedown(function (e) {
e.stopPropagation();
});
})
Demo: Fiddle