Enabling Zoom using jQuery and CSS.
💻 coding

Enabling Zoom using jQuery and CSS.

1 min read 113 words
1 min read
ShareWhatsAppPost on X
  • 1The tutorial demonstrates how to implement text zooming on a website using jQuery and CSS.
  • 2A select box with various font sizes allows users to dynamically change the text size of website content.
  • 3The jQuery code listens for changes in the select box and adjusts the font size of the main content accordingly.

AI-generated summary · May not capture all nuances

Key Insight
AskGif

"The tutorial demonstrates how to implement text zooming on a website using jQuery and CSS."

Enabling Zoom using jQuery and CSS.

In this post, I want to explain about Text Zooming with jQuery and CSS. This is basic level tutorial just changing style using jQuery script. It's simple to use it for zooming website content.

Javascript Code

Contains javascript code. $("#zoom").change(funtion(){}- zoom is the id name of the select box. Using $("#zoom").val(); calling select box value. Applying style at $("#main").css

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/
libs/jquery/1.3.0/jquery.min.js"></script>
<script type="text/javascript">
$(function() 
{

$("#zoom").change(function() 
{

var size = $(this).val();
$("#main").css('font-size', size+'px');

return false;
});
});
</script>

HTML Code

Contains HTML code.

Zoom Text: 
<select id="zoom">
<option value="25">25 </option>
<option value="50">50 </option>
<option value="75">75 </option>
<option value="100">100 </option>
<option value="150">150 </option>
<option value="200">200 </option>
</select>

<div id="main">
Website Content
</div>

Enjoyed this article?

Share it with someone who'd find it useful.

ShareWhatsAppPost on X

AskGif

Published on 20 September 2019 · 1 min read · 113 words

Part of AskGif Blog · coding

You might also like