I am working on a project and having trouble to increase or decrease font size of the site. I am using wordpress, Genesis framework but unable to increase/decrease font size via javascript.
Please kindly help me to solve this.
i use the following code;
genesis_after Hook
This hook executes immediately before the closing tag.
<script type="text/javascript" language="javascript">
$(document).ready(function(){
// Reset Font Size
var originalFontSize = $('html').css('font-size');
$(".resetFont").click(function(){
$('html').css('font-size', originalFontSize);
});
// Increase Font Size
$(".increaseFont").click(function(){
var currentFontSize = $('html').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*1.2;
$('html').css('font-size', newFontSize);
return false;
});
// Decrease Font Size
$(".decreaseFont").click(function(){
var currentFontSize = $('html').css('font-size');
var currentFontSizeNum = parseFloat(currentFontSize, 10);
var newFontSize = currentFontSizeNum*0.8;
$('html').css('font-size', newFontSize);
return false;
});
});
</script>
genesis_before_content Hook
This hook executes immediately before the content column (outside the #content div).
<a href="#" class="increaseFont">Increase</a>
<a href="#" class="decreaseFont">Decrease</a>
<a href="#" class="resetFont">Reset</a>
my project link is
http://174.121.86.229/~rghlifts/
please help me to resolve the issue
thank you all
In WordPress jQuery is default with noConflict. You must change in your script all “$” to “jQuery”.