, , . , , . , Kindle Android ( html- ): http://www.techsavys.info/2011/09/review-on-kindle-for-android-an-ereader-which-beats-all.html
, , - :
<button id="largerFont">Larger Font</button>
<button id="smallerFont">Smaller Font</button>
<p id="container">Change the font size of this.</p>
javascript, , ( 1 , , ), ( , , , ):
$(document).ready(function() {
var size = parseInt($('#container').css('font-size').replace("px", ""), 10);
var incrementAmount = 4;
var increments = 1;
$("#largerFont").click(function(){
var curSize = parseInt($('#container').css('font-size').replace("px", ""), 10);
$('#container').css('font-size', curSize + incrementAmount);
if ((curSize + incrementAmount) >= (size + (incrementAmount * increments))) {
$("#largerFont").prop("disabled", true);
}
$("#smallerFont").prop("disabled", false);
return false;
});
$("#smallerFont").click(function(){
var curSize = parseInt($('#container').css('font-size').replace("px", ""), 10);
$('#container').css('font-size', curSize - incrementAmount);
if ((curSize - incrementAmount) <= (size - (incrementAmount * increments))) {
$("#smallerFont").prop("disabled", true);
}
$("#largerFont").prop("disabled", false);
return false;
});
});
Here is the script for you: http://jsfiddle.net/fordlover49/jbXmE/1/
source
share