WordPress.org

Forums

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

  1. mgudmastad
    Member
    Posted 1 year 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 Martel
    Member
    Plugin Author

    Posted 1 year 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!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP Tiles
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic