Resize Widget uses a similar technique of Increase, Decrease, Reset Font size but displays in T+ , T , T- technique like most of the Wordpress Blogs use.
BACKUP YOUR TEMPLATE BEFORE YOU TRY THIS!
1.Blogger users Login to Dashboard > Layout > Edit HTML. Please Don't check "Expand Widget Templates" it will simplify your codes and will be easier.
2. Add resizeFont to your blog, the following code just before
]]></b:skin>
tag in Blogger Template.
#resizeFont{
text-align:right;
margin-right:10px;
}
Now Add jQuery.
As Always, add the jQuery part before the
</head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(function(){
$('input').click(function(){
var ourText = $('#content-wrapper');
var currFontSize = ourText.css('fontSize');
var finalNum = parseFloat(currFontSize, 10);
var stringEnding = currFontSize.slice(-2);
if(this.id == 'large') {
finalNum *= 1.1;
}
else if (this.id == 'small'){
finalNum /=1.1;
}
else if (this.id == 'reset'){
finalNum =13;
}
ourText.animate({fontSize: finalNum + stringEnding},500);
});
});
</script>
4. Final Step, configure the Widget
Save Your Template , Now go to Layout > Add a Gadget > HTML/JavaScript and paste the code below and Save.
<div id='resizeFont'>
<input id='large' type='button' value='A+'/>
<input id='reset' type='button' value='A'/>
<input id='small' type='button' value='A-'/>
</div>
BACKUP YOUR TEMPLATE BEFORE YOU TRY THIS!
1.Blogger users Login to Dashboard > Layout > Edit HTML. Please Don't check "Expand Widget Templates" it will simplify your codes and will be easier.
2. Add resizeFont to your blog, the following code just before
]]></b:skin>
tag in Blogger Template.
#resizeFont{
text-align:right;
margin-right:10px;
}
Now Add jQuery.
As Always, add the jQuery part before the
</head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js' type='text/javascript'/>
<script type='text/javascript'>
$(function(){
$('input').click(function(){
var ourText = $('#content-wrapper');
var currFontSize = ourText.css('fontSize');
var finalNum = parseFloat(currFontSize, 10);
var stringEnding = currFontSize.slice(-2);
if(this.id == 'large') {
finalNum *= 1.1;
}
else if (this.id == 'small'){
finalNum /=1.1;
}
else if (this.id == 'reset'){
finalNum =13;
}
ourText.animate({fontSize: finalNum + stringEnding},500);
});
});
</script>
4. Final Step, configure the Widget
Save Your Template , Now go to Layout > Add a Gadget > HTML/JavaScript and paste the code below and Save.
<div id='resizeFont'>
<input id='large' type='button' value='A+'/>
<input id='reset' type='button' value='A'/>
<input id='small' type='button' value='A-'/>
</div>
Δεν υπάρχουν σχόλια:
Δημοσίευση σχολίου
Το σχόλιό σας μετράει !