Ability to click anywhere on a classic card

Hey there,

I am using some classic cards on my home page (and some others).

I was wondering, is there any possibility to make this :

When you hover on the card, it flips (which it actually already does)
And once you see the back of it, if you click on it, opens a new page, without having to click on the button but anywhere on it?

Links in a secure note :slight_smile:
Thanks for your help!

Hi,

To achieve that you can add this in Theme Options > JS


jQuery(function($) {
    $( ".mycard .x-face-outer.back" ).on( "click", function() {
        var mypage = $(this).find(".x-face-button").attr("href");
	window.location = mypage;
    });
});

Hope that helps.

Thanks!

Just before doing anything ; will it do it on every page with a classic card if I do it?

Hi There,

Just replace .mycard with .x-card-outer, so that it should apply globally.

jQuery(function($) {
    $( ".x-card-outer .x-face-outer.back" ).on( "click", function() {
        var mypage = $(this).find(".x-face-button").attr("href");
	window.location = mypage;
    });
});

Hope that helps.

Works perfectly! Thanks a lot and have a nice day. :slight_smile:

You are most welcome. :slight_smile:

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.