kier0
3/19/2015 - 8:22 AM

Make any DIV a clickable link. Div must include a tag ( <a href=".."></a> ) This code will look for the first link tag inside the DIV Examp

Make any DIV a clickable link. Div must include a tag ( ) This code will look for the first link tag inside the DIV

Example below has 3 divs

<?php wp_enqueue_script('jquery'); ?>
<script>
jQuery(document).ready(function () {
jQuery(".landing-left-half").click(function(){
        window.location = jQuery(this).find("a:first").attr("href");
        return false;
    });
jQuery(".landing-top-right").click(function(){
        window.location = jQuery(this).find("a:first").attr("href");
        return false;
    });
jQuery(".landing-bottom-right").click(function(){
        window.location = jQuery(this).find("a:first").attr("href");
        return false;
    });
});
</script>