Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Helper que permite hacer linkeable un <div> a la URL que tiene seteada el primer elemento <a> dentro de él.
<div class="box">
<h2>Box Title</h2>
<p>The Quick Brown Fox Jumped Over The Lazy Dog</p>
<p><a class="divLink" href="">Webpage URL</a></p>
jQuery(document).ready(function () {
// Or use this to Open link in same window (similar to target=_blank)
window.location = jQuery(this).find("a:first").attr("href");
return false;
// Show URL on Mouse Hover
jQuery(".box").hover(function () {
window.status = jQuery(this).find("a:first").attr("href");
}, function () {
window.status = "";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment