I’m stuck trying to bind a click redirect to the body tag on a page where there’s not already another div. I have a typical header, container and footer layout but I want to place a site skin in the background for users to click on to register.
Here’s what I have so far to target the body element:
$('body').bind({
click: function() {
window.location = 'https://example.com/';
},
})
The background image displays fine and the redirect works but if I click on somewhere in the header, container or footer it will perform the redirect which is not what I want. I’d prefer it ignore those divs for purpose of the redirect.
Thanks for any suggestions!
Fiddle