Make card component clickable

Menachem came up with this code for me to make the card components clickable :

cards


var webInquiriesHasLoaded = false;
function checkIfWebInquiriesHasLoaded() {
if(webInquiriesHasLoaded === false) {
if ($(’#x_element_page_01_01 .af-card-component’).html() !== undefined) {
webInquiriesHasLoaded = true;
}
window.setTimeout(checkIfWebInquiriesHasLoaded, 100);
} else {
$(’#x_element_page_01_01 .af-card-component’).css(‘cursor’,‘pointer’);
$(’#x_element_page_01_01 .af-card-component’).on(‘click’,function(){
window.location.href = ‘/#!/your-page’;
});
}
}
checkIfWebInquiriesHasLoaded();


You will need to change the var and function names to something relevant to your card name and you will need to get the x_element_page_??_?? of your card and finally the URL that you want to send people to from that card.

4 Likes