Make background / column clickable to URL

Author: 

Marcel Pol


Description: 

Script looks for a URL in the module / block.

See it at work on https://www.letsplant.nl/

cursor with css to the right pointer;




Kind:

jQuery, Beaver


CSS:

cursor: pointer;


Javascript:

jQuery(document).ready(function() {
jQuery('.home .blok1 > .fl-col-content').click(function() {
var col_link = jQuery(this).find('a').first().attr('href');
if ( typeof col_link != 'undefined' ) {
window.location.href = col_link;
}
});
jQuery('.home .blok2 > .fl-col-content').click(function() {
var col_link = jQuery(this).find('a').first().attr('href');
if ( typeof col_link != 'undefined' ) {
window.location.href = col_link;
}
});
jQuery('.home .blok3 > .fl-col-content').click(function() {
var col_link = jQuery(this).find('a').first().attr('href');
if ( typeof col_link != 'undefined' ) {
window.location.href = col_link;
}
});
jQuery('.home .blok4 > .fl-col-content').click(function() {
var col_link = jQuery(this).find('a').first().attr('href');
if ( typeof col_link != 'undefined' ) {
window.location.href = col_link;
}
});
jQuery('.home .blok5 > .fl-col-content').click(function() {
var col_link = jQuery(this).find('a').first().attr('href');
if ( typeof col_link != 'undefined' ) {
window.location.href = col_link;
}
});
});


URL: