WordPress.org

Ready to get started?Download WordPress

Forums

WP Tiles
[resolved] Pop up on hover or click (2 posts)

  1. mgudmastad
    Member
    Posted 6 months ago #

    I would like to have a text box pop up on tile click. Text would be a short description, a few sentences. Is this possible?

    https://wordpress.org/plugins/wp-tiles/

  2. Mike
    Member
    Plugin Author

    Posted 6 months ago #

    Hi there!

    This is possible only with some custom coding. The most elegant way I can see to do this without modifying the plugin is using the byline as the popup.

    What you'd do is hide the byline extra content (ie. the excerpt, categories, etc. that you can show on WP Tiles) using CSS:
    .tile-byline .extra { display: none; }
    Next, you only have to write a little JS to show the byline in a popup. Something along the lines of:

    (function($){
        var $tiles = $('.tile-bg, .tile-color');
    
        $tiles.attr('onclick',''); // Reset the WP Tiles click handler
    
        $tiles.click(function(e){
            var text = $(this).find('.tile-byline .extra').text();
            alert(text);
        })
    })(jQuery);

    (this works! Just replace the alert by your popup function..)

    Good luck!

Reply

You must log in to post.

About this Plugin

About this Topic