Enlarge text with buttons and js, with limited max- and min sizes

Developer
Size
1,756 Kb
Views
56,672

How do I make an enlarge text with buttons and js, with limited max- and min sizes?

What is a enlarge text with buttons and js, with limited max- and min sizes? How do you make a enlarge text with buttons and js, with limited max- and min sizes? This script and codes were developed by Eduard Mayer on 13 July 2022, Wednesday.

Enlarge text with buttons and js, with limited max- and min sizes Previews

Enlarge text with buttons and js, with limited max- and min sizes - Script Codes HTML Codes

<!DOCTYPE html>
<html >
<head> <meta charset="UTF-8"> <title>Enlarge text with buttons and js, with limited max- and min sizes</title>
</head>
<body> <button class="text-gr">Bigger</button>
<button class="text-kl">Smaller</button>
<p class="ticker">Current font size: 1em</p>
<p class="target">Lorem ipsum dolor sit amet, consectetur adipisicing elit. Quaerat error cumque perferendis. Delectus necessitatibus laboriosam dignissimos et quos consequuntur velit explicabo totam deserunt officia animi fuga ex praesentium culpa maiores.</p> <script src='http://cdnjs.cloudflare.com/ajax/libs/jquery/2.1.3/jquery.min.js'></script> <script src="js/index.js"></script>
</body>
</html>

Enlarge text with buttons and js, with limited max- and min sizes - Script Codes JS Codes

var _target = '.target', _size = 1;
$('.text-gr').on('click', function(){	_size = (_size >= 3) ? 3 : _size += 0.25; $(_target).css('font-size', _size + 'em'); $('.ticker').html('Current font size: ' + _size + 'em');
});
$('.text-kl').on('click', function(){	_size = (_size <= 1) ? 1 : _size -= 0.25; $(_target).css('font-size', _size + 'em'); $('.ticker').html('Current font size: ' + _size + 'em');
});
Enlarge text with buttons and js, with limited max- and min sizes - Script Codes
Enlarge text with buttons and js, with limited max- and min sizes - Script Codes
Home Page Home
Developer Eduard Mayer
Username codewunder
Uploaded July 13, 2022
Rating 3
Size 1,756 Kb
Views 56,672
Do you need developer help for Enlarge text with buttons and js, with limited max- and min sizes?

Find the perfect freelance services for your business! Fiverr's mission is to change how the world works together. Fiverr connects businesses with freelancers offering digital services in 500+ categories. Find Developer!

Eduard Mayer (codewunder) Script Codes
Create amazing marketing copy with AI!

Jasper is the AI Content Generator that helps you and your team break through creative blocks to create amazing, original content 10X faster. Discover all the ways the Jasper AI Content Platform can help streamline your creative workflows. Start For Free!