Navigation
This is archived content. Visit our new forum.
  • Author
    Posts
  • #721588

    luminate
    Participant
    
    (function($){
      $('.x-recent-posts a').on('click touchstart', function(){
        return false;
      });
    })(jQuery);
    

    This javascript code also disables the ability to scroll when on a mobile device. Is there any other way to achieve this without breaking touch ability?

    #721743

    Rad
    Moderator

    Hi there,

    Please try this one,

    jQuery('.x-recent-posts a').off('click touchstart');

    Removing the binding is easier than disabling it. Because it may also disable the event chains that also triggers the scroll.

    Cheers!

    #721811

    luminate
    Participant

    That does allow touch to work now, however the page jumps to the top when clicked or tapped.

    Any other help appreciated.

    Thanks

    #721842

    Rad
    Moderator

    Hi there,

    Please try this one 🙂

    jQuery('.x-recent-posts a').off('click touchstart touchend').on('click', function(e){ e.preventDefault(); });

    I think, that should do it.

    Cheers!

    #721850

    luminate
    Participant

    Thanks for your help, however that did not fix the problem.

    Regards,

    #721856

    Rad
    Moderator

    Hi there,

    In that case, please provide your site’s URL and the area where the issue is occurring.

    Thanks!

    #721869

    luminate
    Participant
    This reply has been marked as private.
    #721882

    Rue Nel
    Moderator

    Hello There,

    Thanks for providing the login information. Please try to use this method instead. Simply edit your page and in the settings tab, Settings > Custom CSS, please insert the following css

    .x-recent-posts a {
        pointer-events: none;
    }

    If this works out, you may need to remove the JS code we gave in our previous reply.
    We would loved to know if this has work for you. Thank you.

    #721888

    luminate
    Participant

    Thank works! Thank you so much!

    If you ever feel like letting me know how to make it now accept the html from the post (instead of just the text) I would be very grateful.

    #721892

    Rad
    Moderator

    Hi there,

    You’re welcome.

    Are you referring to your other thread? https://community.theme.co/forums/topic/show-full-post-content-in-cornerstone-recent-posts-element/

    Have you tried that? If yes, please let us know how it goes.

    Allowing HTML requires removal of your recent posts link wrapper.

    Thanks.