How can I add a ‘Click to Enlarge Image’ feature, with the enlarged image opening in a popup?

I have several images of UI forms and tasks, that are quite large. I would like to display a smaller, ‘thumbnail’ image snf give the user an option to ‘Click to Enlarge’, and then display the fill size image in either a pop-up or separate window or tab. I pop-ups are frowned upon, but this is a decision I must still make.

How would I go about this? Where would I place the JavaScript that loads the full size image and opens a new window?

Related posts

Leave a Reply

2 comments

  1. <?php get_header(); ?>
    <?php get_sidebar();?>
        <div id="content">
            <?php if ( have_posts() ) : ?>
                <?php while ( have_posts() ) : the_post(); ?>
                    <article id="post-<?php the_ID(); ?>" <?php post_class($class); ?>>
                        <header class="entry-header">
                            <?php if(has_post_thumbnail()):?>
                                <?php the_post_thumbnail(); ?>
                            <?php endif; ?>
                            <h1 class="entry-title">
                                <a href="<?php the_permalink(); ?>" title="<?php printf( esc_attr__( 'Permalink to %s', 'ifoti' ), the_title_attribute( 'echo=0' ) ); ?>" rel="bookmark"><?php the_title(); ?></a>
                            </h1>
                            <?php if ( 'post' == get_post_type() ) : ?>
                            <div class="entry-meta">
                                <?php ifoti_posted_on(); ?>
                            </div><!-- .entry-meta -->
                            <?php endif; ?>
                        </header><!-- .entry-header -->
    
                        <?php if ( is_search() ) : // Only display Excerpts for Search ?>
                        <div class="entry-summary">
                            <?php the_excerpt(); ?>
                        </div><!-- .entry-summary -->
                        <?php else : ?>
                        <div class="entry-content">
                            <?php the_content( __( 'Continue reading <span class="meta-nav">&rarr;</span>', 'ifoti' ) ); ?>
                            <?php wp_link_pages( array( 'before' => '<div class="page-link"><span>' . __( 'Pages:', 'ifoti' ) . '</span>', 'after' => '</div>' ) ); ?>
                        </div><!-- .entry-content -->
                        <?php endif; ?>
    
                        <footer class="entry-meta">
                            <?php $show_sep = false; ?>
                            <?php if ( 'post' == get_post_type() ) : // Hide category and tag text for pages on Search ?>
                            <?php
                                $categories_list = get_the_category_list( __( ', ', 'ifoti' ) );
                                if ( $categories_list ):
                            ?>
                            <span class="cat-links">
                                <?php printf( __( '<span class="%1$s">Posted in</span> %2$s', 'ifoti' ), 'entry-utility-prep entry-utility-prep-cat-links', $categories_list );
                                $show_sep = true; ?>
                            </span>
                            <?php endif; // End if categories ?>
                            <?php
                                $tags_list = get_the_tag_list( '', __( ', ', 'ifoti' ) );
                                if ( $tags_list ):
                                if ( $show_sep ) : ?>
                            <span class="sep"> | </span>
                                <?php endif; // End if $show_sep ?>
                            <span class="tag-links">
                                <?php printf( __( '<span class="%1$s">Tagged</span> %2$s', 'ifoti' ), 'entry-utility-prep entry-utility-prep-tag-links', $tags_list );
                                $show_sep = true; ?>
                            </span>
                            <?php endif; // End if $tags_list ?>
                            <?php endif; // End if 'post' == get_post_type() ?>
    
                            <?php if ( comments_open() ) : ?>
                            <?php if ( $show_sep ) : ?>
                            <span class="sep"> | </span>
                            <?php endif; // End if $show_sep ?>
                            <span class="comments-link"><?php comments_popup_link( '<span class="leave-reply">' . __( 'Leave a reply', 'ifoti' ) . '</span>', __( '<b>1</b> Reply', 'ifoti' ), __( '<b>%</b> Replies', 'ifoti' ) ); ?></span>
                            <?php endif; // End if comments_open() ?>
                            <span class="sep"> | </span>
                            <?php edit_post_link( __( 'Edit', 'ifoti' ), '<span class="edit-link">', '</span>' ); ?>
                        </footer><!-- #entry-meta -->
                        <div class="socialbtn">
                            <!-- AddThis Button BEGIN -->
                            <div class="addthis_toolbox addthis_default_style"addthis:url="<?php the_permalink() ?>">
                                <a class="addthis_button_email">Email</a>
                                <a class="addthis_button_print">Print</a>
                                <a class="addthis_button_facebook_like" fb:like:layout="button_count"></a>
                                <a class="addthis_button_tweet"></a>
                                <a class="addthis_button_google_plusone" g:plusone:size="medium"></a>
                            </div>
                            <script type="text/javascript">var addthis_config = {"data_track_addressbar":true};</script>
                            <script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#pubid=ra-4f97067f47ad8fdb"></script>
                            <!-- AddThis Button END -->
                        </div>
    
                        <div>
                            <?php comments_template();?>
                        </div>
                    </article><!-- #post-<?php the_ID(); ?> -->
                <?php endwhile; ?>
            <?php else : ?>
                No Result;
            <?php endif; ?>
        </div>
    <?php get_footer(); ?>
    

    List item