I have a problem with nested divs, and jQuery’s click function.
Clicking on .header-fb, .header-twitter or .header-linkedin don’t give any results. No errors in console. I’m not sure what’s going on. These classes have background image, not sure, if that makes problem too. Here’s the code:
<div>
<div id="header-social" class="four columns mobile-two">
<div class="header-fb"><a href="http://www.facebook.com" > </a></div>
<div class="header-twitter"><a href="https://twitter.com" > </a></div>
<div class="header-linkedin"><a href="http://www.linkedin.com/"> </a></div>
</div>
and javascript:
<script type="text/javascript">
jQuery(document).ready(function() {
jQuery(".header-fb").click(function(){
window.location=jQuery(this).find("a").attr("href");
return false;
});
jQuery(".header-twitter").click(function(){
window.location=jQuery(this).find("a").attr("href");
return false;
});
jQuery(function() {
jQuery('.header-linkedin').click(function(){
window.location=jQuery(this).find("a").attr("href");
return false;
});
});
});
</script>
IF your HTML should look like this:
Than you can try with:
http://jsbin.com/uxowoj/1/edit