jQuery Plugin To Scale Web Elements Based On Screen Size Smartzoom - Download jQuery Plugin To Scale Web Elements Based On Screen Size - Smartzoom

Download jQuery Plugin To Scale Web Elements Based On Screen Size – Smartzoom

Posted on

This time I will share jQuery Plugin and tutorial about jQuery Plugin To Scale Web Elements Based On Screen Size – Smartzoom, hope it will help you in programming stack.

jQuery Plugin To Scale Web Elements Based On Screen Size Smartzoom - Download jQuery Plugin To Scale Web Elements Based On Screen Size - Smartzoom
File Size: 7.62 KB
Views Total: 784
Last Update:
Publish Date:
Official Website: Go to website
License: MIT
   

Smartzoom is a jQuery plugin that automatically scales web elements and font sizes based on the screen size to provides better readability across the platforms.

How to use it:

1. Add the following meta viewport in the head of the document.

1 <meta name="viewport" content="width=device-width, initial-scale=1">
2 <!-- OR -->
3 <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no">

2. Use relative units (e.g. em, percent) for font-size handling.

1 body {
2   font-size: 62.5%;
3 }
4  
5 h1 {
6   font-size: 2em;
7 }

3. Link to jQuery library and the jQuery Smartzoom plugin like this:

1 <script src="//code.jquery.com/jquery.min.js"></script>
2 <script src="jquery.smartzoom.min.js"></script>

4. Invoke the plugin with default settings.

1 $.smartzoom.initialize();

5. Set the font size when scaling.

1 $.smartzoom.initialize({
2   fontSize: 62.5 // 62.5% (1em = 10px)
3 });

6. Set break point (screen width) to trigger the auto scaling.

1 $.smartzoom.initialize({
2   width:    320
3 });

This awesome jQuery plugin is developed by getphuture. For more Advanced Usages, please check the demo page or visit the official website.

source : jqueryscript.net