Using JavaScript to create fancy animations and add unnecessary but interesting interaction is great. However, the real boon comes when you use it to provide users with something that helps them to use your site, and that emphasizes your content.
First, you need to decide what text you want to be able to resize. For every element that you want resizable text in, add the text-resizable
class. In this example, let's set the post content to be resizable, within the WordPress loop in the index.php
file, placing the font-resizable
opening div
tag just above the entry-content
opening div
tag, then closing both tags, as shown in the following code:
<!-- make the content entry text resizable --> <div class="font-resizable"> <div class="entry-content"> <?php the_content( __( 'Read More <span class="meta-nav">»</span>', 'sandbox' ) ) ?> <?php wp_link_pages('before=<div class="page-link">' . __( 'Pages:...