25 thg 12, 2012

Tăng giảm cỡ chữ nội dung bài đăng

Cách 1: Dùng JS
1. Đầu tiên vào tài khoản blogger
2. Vào Thiết kế chọn chỉnh sửa HTML (Edit HTML)
3. Chọn phần mở rộng tiện ích (Expand Widget Templates)
4. Tìm đến code bên dưới:
<data:post.body/>
Thay nó thành code sau
<div id='post_body'>
<data:post.body/>
</div> 
5. Chèn tiếp code bên dưới vào trước thẻ  </head>
<script src='http://namknablog.googlecode.com/files/text_sizer.js' type='text/javascript'/>
 6. Tiếp đến hãy tìm đến đoạn code bên dưới hoặc tương tự
<div class='post-header-line-1'/>
7. Sau đó chèn code bên dưới vào sau code vừa tìm được
<div style='float:right; margin: 0px 0px 0px 0px;font-size:12px;font-family:times; color:#000099;'>Cở chữ: <a href='javascript:ts(&quot;post_body&quot;,-1)'><img
 align='top' border='0'
src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgmCjkl0o0xR3sq7XY0qgqGMdMLMGDSkdVMWzcbO6O__towKm_GrHm5JW0tN17xOcMpW0CGpKb0gd4TFyj36NGjxn3eKFRGhdBz4onYdLwn6LuVkXvc_EMvwlWcNnSSTqpmhN7ADH3dCkza/s1600/font_normal-namkna-blogspot-com-ngoctra.gif'
 title='Giảm cở chữ'/></a><a href='javascript:ts(&quot;post_body&quot;,1)'><img
 align='top' border='0'
src='https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiO_5i-bN_KFVm56W1TdQ1nylLtMFwNvcwZUoN3aJwjaJWQFvopdQc13W7IXBFDm_eAT1U3WHy8FK_ddGOtAvCOAMEF4QsirLSEgAEUfhuMhxwjeyMGXPEsY5CrqvMx567VkcOA1eRl1_lD/s1600/font_enlarge-namkna-blogspot-com-ngoctra.gif'
 title='Tăng cở chữ'/></a> </div> 
8. Cuối cùng save template lại là xong

Cách 2: Dùng JavaScript
Dán code sau vào HTML/Javarscrip
<script type='text/javascript'>
var tgs = new Array( 'div','td','tr');
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;
function ts( trgt,inc ) {
if (!document.getElementById) return
var d = document,cEl = null,sz = startSz,i,j,cTags;
sz += inc;
if ( sz < 0 ) sz = 0;
if ( sz > 6 ) sz = 6;
startSz = sz;
if ( !( cEl = d.getElementById( trgt ) ) ) cEl = d.getElementsByTagName( trgt )[ 0 ];
cEl.style.fontSize = szs[ sz ];
for ( i = 0 ; i < tgs.length ; i++ ) {
cTags = cEl.getElementsByTagName( tgs[ i ] );
for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
}
}
</script>
<a href="javascript:ts('body',1)"><img
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhAKB7UK781cLWr00xKG9tZT4HMV0jUa_iQIC0WqpB090YF6YeZmY0IB61hllsQVgBi40IpKx5nlqCp7OQXl30GE6a60zXuRDnjKsCzER7Xk59fdLwK4UJ7o-3D2BZe2ByMsmDer9ymhX0c/s1600/tang-co-chu-blogspot-namkna-ngoctra.png"
 alt="+A" /></a><a href="#"
onclick="location.reload(true);"><img
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiZN5jkVmFR43UPD51josMHkWtV6PBIdCStoDTiYv2odNR7KR7N8l7iSPR3fE6UmK-pr7jHRCcJlWzjnqpNK8zCUW4N1HVq0ozNC9hhnPbTpOX-E4GeVJURu5xF20Pm2Yu57APzfVHNuOwV/s1600/tang-co-chu-blogspot-namkna-ngoctra-2.png"
 alt="=A" /></a><a
href="javascript:ts('body',-1)"><img
src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjosk0zwArN8LGOqOxfVKvPCDkIngV6xXRnQ-3KB3TVsaw6yOoZkexfkv-KmMRf714skq9Qt4aSY0DA6BvORZ4grsfcPItaeETJDLA0I4ogpzQG3el-FypVF3aaQxtLGKGzGATtDhyZ0Gjr/s1600/tang-co-chu-blogspot-namkna-ngoctra-3.png"
 alt="-A" /></a> 
Share this post
  • Share to Facebook
  • Share to Twitter
  • Share to Google+
  • Share to Stumble Upon
  • Share to Evernote
  • Share to Blogger
  • Share to Email
  • Share to Yahoo Messenger
  • More...

0 nhận xét

Vui lòng gõ tiếng Việt có dấu ^^!

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

 
Designed by Thái Duy
Ho Chi Minh City, Dec 2012
© 2012. All rights reserved.
Back to top ↑