'글씨크기 조절 버튼'에 해당되는 글 1건

  1. 2008/08/31 글씨크기 조절 버튼달기 (2)
블로그에 글씨크기를 줄이고 늘리는 버튼을 달수 있습니다.

1. 먼저, 아래의 소스를 <body>위에 삽입합니다.
<!-- 글씨 크기 늘리기 줄이기 요기부터 -->

<script type="text/javascript">

var CurrentFontSize = 10
var CurrentLineHeight = 10

function SetFontSize(SizeFlag) {
obj = document.getElementById("chgsize")

if (SizeFlag == 'B') {
CurrentFontSize = CurrentFontSize + 1
CurrentLineHeight = parseInt(CurrentFontSize*1.5)
obj.style.fontSize = CurrentFontSize + "pt"
obj.style.lineHeight = CurrentLineHeight + "pt"}

else {
if (CurrentFontSize>0) {
CurrentFontSize = CurrentFontSize - 1
CurrentLineHeight = parseInt(CurrentFontSize*1.5)}
obj.style.fontSize = CurrentFontSize + "pt"
obj.style.lineHeight = CurrentLineHeight + "pt"}}

function SetSummarySize() {
if (strlength == 'strshort') {
document.getElementById("img_more").Style.display = 'none';}}

</script>
<!-- 글씨 크기 늘리기 줄이기 요기까지 복사-->

2. 그다음 아래와같은 소스를 글씨크기 조절 버튼을 설치할 적당한 곳에 삽입합니다. +,- 표시는 이미지로 대체하셔도 됩니다.
글씨크기<a href=javascript:SetFontSize('B')>+</a><a href=javascript:SetFontSize('S')>-</a>

3. 마지막으로 글씨크기가 변경될 영역을 선택해줍니다.
<span id="chgsize">                      
[ # #_article_rep_desc_# # ] <-- 요 부분을 찾아서 앞 뒤로 <span>태크를 넣어 줍니다.
</span>

Posted by 웹눈