Skip to content


Subversion checkout URL

You can clone with
Download ZIP
tree: 318c98fd1e
Fetching contributors…

Cannot retrieve contributors at this time

101 lines (78 sloc) 3.75 kb
<!DOCTYPE html>
<html lang="en">
<meta charset="UTF-8">
<title>Anything Zoomer | Text</title>
<link href="" rel="stylesheet">
<link rel="stylesheet" href="demo/style.css">
<link rel="stylesheet" href="css/anythingzoomer.css">
<script src=""></script>
<script src="js/jquery.anythingzoomer.js"></script>
$(function() {
// clone the small area, the css will define the dimensions
// default class name for the large area is "large"
clone: true
// zoom in
// .small p { font-size: 8px; width: 300px; }
var origW = 300,
origSz = 8,
// get multiple
multiple = parseInt( $(this).text() );
$('.large p').css({
width: origW * multiple,
fontSize: origSz * multiple
// update anythingZoomer window,
// but first turn off clone since cloning the small area again will remove our changes
$('#zoom').getAnythingZoomer().options.clone = false;
<body id="text">
<div id="main-content">
<a href="" id="dl">Download</a>
<ul id="nav">
<li><a href="index.html">Calendar</a></li>
<li><a href="image.html">Image</a></li>
<li><a href="swap.html">Swap</a></li>
<li><a class="current" href="text.html">Text</a></li>
<li><a href="double.html">Double</a></li>
<li><a class="use" href="use.html">Usage</a></li>
<li><a class="play" href="">Playground</a></li>
<li><a class="issue" href="">Issues</a></li>
<h2>Text Demo</h2>
<ul class="info">
<li>This demo uses the "clone" option to clone the original "small" content.</li>
<li>The new "large" content must have existing css definitions to determine it's style.</li>
<li>Change the size of the large content by clicking the buttons below; the update method is used here.</li>
<li><em>Note:</em> There is an issue with the zoom window being positioned more down and right as the large content size increases. I'll keep looking for a solution, but for now you can use the <code>offsetX</code> and <code>offsetY</code> options to tweak the position.</li>
<button class="selected">2x</button>
<div id="zoom" class="text">
<div class="small">
<p>Pellentesque habitant morbi tristique senectus et netus et malesuada fames ac turpis egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit amet quam egestas semper. Aenean ultricies mi vitae est. Mauris placerat eleifend leo. Quisque sit amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, commodo vitae, ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis tempus lacus enim ac dui. Donec non enim in turpis pulvinar facilisis. Ut felis. Praesent dapibus, neque id cursus faucibus, tortor neque egestas augue, eu vulputate magna eros eu erat. Aliquam erat volutpat. Nam dui mi, tincidunt quis, accumsan porttitor, facilisis luctus, metus.</p>
<!-- the cloned "small" content will be added to div.large -->
<div class="large">This text will be replaced since the "clone" option is set to true</div>
</div> <!-- end zoom -->
</div> <!-- end main content -->
Jump to Line
Something went wrong with that request. Please try again.