Plugin for a text modal box

I have a contact form with “Accept Privacy Policy” check box. I need to add a link, that will create a modal box displaying the privacy policy. Just like fancy box but for text.

I was looking for a plugin that would help me. I looked at OrangeBox and Modal Dialog but it seems they don’t do what I’m looking for.

Read More

Is there a WP plugin or some jQuery that could help me create a custom text modal box?

Related posts

Leave a Reply

2 comments

  1. Fancybox works great for displaying content as well as images or videos. To display content, use something like:

    $.fancybox('<h1>My html content here</h1>', {
       fancyOption: 'fancyValue'
    });
    

    This functionality is documented on fancybox’s How To page.

    You can also use fancybox the same way you do for a link to an image, only for a link to content:

    <a href="#my-fancy-content" class="show-privacy-policy">Privacy Policy</a>
    <div style="display:none;">
        <div id="my-fancy-content"> --- your privacy policy here --- </div>
    </div>
    <script>
        $('a.show-privacy-policy').fancybox({
            fancyOption: 'fancyValue'
        });
    </script>
    
  2. You also have the option of using either Thickbox or jQuery-ui Modal. Those both ship with WordPress already, so you just enqueue the script (and styles) in the case of Thickbox in your theme’s functions.php:

    wp_enqueue_script( 'thickbox' );
    wp_enqueue_style( 'thickbox' );
    wp_enqueue_style( 'jquery-ui-modal' );
    

    Modal in particular is loaded with options and jQuery UI has a theme builder you can use for making a stylesheet for the window.