Jquery Course

Examples AnythingZoomer

AnythingZoomer is a jQuery plugin that can be used to zoom part of image, text, or other HTML content, like an eyeglass. It's flexible in many ways, in that the "small", "large", and "zoom" areas are all pretty easy to customize (via CSS).
- When double-click on the small image or text, it is replaced with the large content.


• To DOWNLOAD this script, click: - version: 2.2.2 (357 KB).

Installation

1. First, to use this plugin, copy the "css" and "js" folders (or their files in "css", respectively "js" folders) on your server. The script comes with jQuery 2.1.0 ("jquery.js" in "js/" directory).
2. Include these files in the <head> zone of your web page:
<link rel="stylesheet" type="text/css" href="css/anythingzoomer.css" />
<script type="text/javascript" src="js/jquery.js"></script>
<script type="text/javascript" src="js/jquery.anythingzoomer.js"></script>
3. The HTML code with the image, or text to be zoomed must be added in this format:
<div class="zoom">
  <div class="small"><img src="image.jpg" alt="small image"></div>
</div>
OR with text:
<div class="zoom">
  <div class="small"><p>Some small text</p></div>
</div>
- The "width" / "height" for the small image, and "font-size" for the small text must be set in CSS (see the examples bellow).

4. Then, create the JavaScript code that apply the anythingZoomer() method to the ".zoom" elements.
<script>
$(function() {
  $(".zoom").anythingZoomer({
    clone: true,       // // clone the small image or text

    // Set this properties if you need to adjust the offset values for the left top corner of the large content
    offsetX : 0,
    offsetY : 0
  });
});
</script>
• More details about anythingZoomer options are in the "index.html" file, in the archive with this script.

Examples AnythingZoomer

Here is a few examples with AnythingZoomer jQuery plugin.

1. Zoom effect for image.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Example AnythingZoomer - Image</title>
<link rel="stylesheet" href="css/anythingzoomer.css">
<style type="text/css">
.small img { width:200px; height: 150px; }
.large img { width: 500px; height: 333px; }
</style>

<script src="js/jquery.js"></script>
<script src="js/jquery.anythingzoomer.js"></script>
<script>
// from: https://coursesweb.net/javascript/
$(function() {
  $(".zoom").anythingZoomer({
    clone: true,       // // clone the small image or text

    // Set this properties if you need to adjust the offset values for the left top corner of the large content
    offsetX : 0,
    offsetY : 0
  });
});
</script>
</head>
<body>
<br>
<div class="zoom">
  <div class="small"><img src="image.jpg" alt="small image"></div>
</div>

</body>
</html>
Demo (double-click to show the large image, then double-click again):
small image

2. Zoom effect for text content.
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Example AnythingZoomer - Text</title>
<link rel="stylesheet" href="css/anythingzoomer.css">
<style type="text/css">
.small p { font-size: 9px; width: 300px; }
.large p { font-size: 18px; width: 600px; }
</style>

<script src="js/jquery.js"></script>
<script src="js/jquery.anythingzoomer.js"></script>
<script>
// from: https://coursesweb.net/javascript/
$(function() {
  $('.zoom_text').anythingZoomer({
    clone: true,       // // clone the small image or text
  });
});
</script>
</head>
<body>
<br>
<div class="zoom_text">
  <div class="small"><p>AnythingZoomer - <strong>Zoom part of Text Content, like an eyeglass</strong>. It's flexible in many ways, in that the "small", "large", and "zoom" areas are all pretty easy to customize (via CSS).<br/>
- When double-click on the small image or text, it is replaced with the large content.<br/>
From: <a href="https://coursesweb.net/jquery/jquery-plugins_jp" title="Useful jQuery Plugins">https://coursesweb.net/</a></p></div>
</div>

</body>
</html>
Demo (double-click to show the large content, then double-click again):

AnythingZoomer - Zoom part of Text Content, like an eyeglass. It's flexible in many ways, in that the "small", "large", and "zoom" areas are all pretty easy to customize (via CSS).
- When double-click on the small image or text, it is replaced with the large content.
From: https://coursesweb.net/

- For other advanced options and examples, see the documentation in "index.html" page from the archive with this jQuery plugin (a Download button is at the beginning of this page).

• The AnythingZoomer home page is at: http://css-tricks.com/anythingzoomer-jquery-plugin/

Daily Test with Code Example

HTML
CSS
JavaScript
PHP-MySQL
Which attribute is used in <a> tag for the address of the link?
src href rel
<a href="http://coursesweb.net/" title="CoursesWeb.net">CoursesWeb.net</a>
Which CSS property sets the type of the text font?
font-family text-decoration font-size
h2 {
  font-family:"Calibri",sans-serif;
}
What instruction selects all the <div> tags with class="cls"?
querySelector("div.cls") getElementsByTagName("div") querySelectorAll("div.cls")
var elm_list = document.querySelectorAll("div.cls");
var nr_elms = elm_list.length;       // number of selected items
alert(nr_elms);
Indicate the function that can be used to get the sum of values in an array.
array_sum() array_diff() array_shift()
$arr =[1, 2, 3, 4);
$arr_sum = array_sum($arr);
echo $arr_sum;       // 10
AnythingZoomer - Zoom part of Image or Text Content

Last accessed pages

  1. Get and Modify content of an Iframe (32494)
  2. The Mastery of Love (7690)
  3. Download HTM resources (90)
  4. HTML5 Quick Tutorial (5041)
  5. Styling HTML table with CSS (412)

Popular pages this month

  1. Courses Web: PHP-MySQL JavaScript Node.js Ajax HTML CSS (715)
  2. CSS cursor property - Custom Cursors (94)
  3. Read Excel file data in PHP - PhpExcelReader (71)
  4. PHP-MySQL free course, online tutorials PHP MySQL code (67)
  5. PHP Unzipper - Extract Zip, Rar Archives (53)