2011-01-06 2 views
-1

나는 JavaScript에 익숙하지 않지만 IE7에서는 텍스트를 앤티 앨리어싱 처리 할 수있는 클리어 타입을 추가해야한다. 나는 비슷한 질문들을 발견했다. 문제는 내가 얻은 코드를 붙여 넣을 적절한 위치를 모른다는 것입니다.나는 IE7에서 효과 fadein 후에 텍스트의 클리어 타입을 잃어 버리는 커스텀 Javascript fadein 함수를 가지고있다.

가 지금은 매우 혼란 스러워요 스크립트의

// JavaScript Document 
var CurrentDivIndex=0; 
var TimeOutValue; 
var btn; 
var TimeToFade = 1000.0; 
function ShowDivSlideShow() 
{ 
try 
{ 
    if(CurrentDivIndex == 5) 
    CurrentDivIndex=0; 

    CurrentDivIndex++; 
    //alert("Banner" + CurrentDivIndex); 
    //alert(CurrentDivIndex); 
    var Indexer=1; 
    while(Indexer<6) 
    { 


    var DivToShow=document.getElementById("Banner" + Indexer); 
    DivToShow.style.display = "none"; 
    btn=document.getElementById("btnb" + Indexer); 
    btn.setAttribute("class","none"); 

     Indexer++; 

    } 



    var DivToShow=document.getElementById("Banner" + CurrentDivIndex); 
    DivToShow.style.display = "block"; 
    btn=document.getElementById("btnb" + CurrentDivIndex); 
    btn.setAttribute("class","activeSlide"); 
// btn.className="activeSlide"; 
    fadeIn(); 
    TimeOutValue=setTimeout("ShowDivSlideShow()",6000); 

} 
catch(err) 
{ 
    alert(err) 
} 
} 



function ShowCustomDiv(CurrentDivIndexRec) 
{ 

clearTimeout(TimeOutValue) 
CurrentDivIndex=CurrentDivIndexRec 

    var Indexer=1; 
while(Indexer<6) 
{ 
    if(CurrentDivIndex==Indexer) 
    { 
    Indexer++; 
    continue; 
    } 

    var DivToShow=document.getElementById("Banner" + Indexer); 
    DivToShow.style.display = "none"; 
    btn=document.getElementById("btnb" + Indexer); 
    btn.setAttribute("class","none"); 
    Indexer++; 

} 

var DivToShow=document.getElementById("Banner" + CurrentDivIndex); 
    DivToShow.style.display = "block"; 
    btn=document.getElementById("btnb" + CurrentDivIndex); 
    btn.setAttribute("class","activeSlide"); 
    btn.className="activeSlide" 
    fadeIn(); 
} 


function ShowDivSlideShowWithTimeOut(CurrentDivIndexRec) 
{ 

clearTimeout(TimeOutValue) 
CurrentDivIndex=CurrentDivIndexRec; 
var Indexer=1; 
    while(Indexer<6) 
    { 
    if(CurrentDivIndex==Indexer) 
    { 
    Indexer++; 
    continue; 
    } 

    var DivToShow=document.getElementById("Banner" + Indexer); 
    DivToShow.style.display = "none"; 
    btn=document.getElementById("btnb" + Indexer); 
    btn.setAttribute("class","none"); 
    Indexer++; 

    } 


var DivToShow=document.getElementById("Banner" + CurrentDivIndexRec); 
    DivToShow.style.display = "block"; 
    btn=document.getElementById("btnb" + CurrentDivIndexRec); 
    btn.setAttribute("class","activeSlide"); 


TimeOutValue=setTimeout("ShowDivSlideShow()",6000); 
} 

function ShowCustomDivOnClick(CurrentDivIndexRec) 
{ 

clearTimeout(TimeOutValue) 
CurrentDivIndex=CurrentDivIndexRec; 

    var Indexer=1; 
    while(Indexer<6) 
    { 
    if(CurrentDivIndex==Indexer) 
    { 
    Indexer++; 
    continue; 
    } 

    var DivToShow=document.getElementById("Banner" + Indexer); 
    DivToShow.style.display = "none"; 

    btn=document.getElementById("btnb" + Indexer); 
    btn.setAttribute("class","none"); 
    Indexer++; 

    } 


var DivToShow=document.getElementById("Banner" + CurrentDivIndexRec); 
    DivToShow.style.display = "block"; 

    btn=document.getElementById("btnb" + CurrentDivIndexRec); 
    btn.setAttribute("class","activeSlide"); 

    fadeIn(); 
TimeOutValue=setTimeout("ShowDivSlideShow()",6000); 
} 

function setOpacity(level) { 
    element=document.getElementById("Banner" + CurrentDivIndex); 
    element.style.opacity = level; 
    element.style.MozOpacity = level; 
    element.style.KhtmlOpacity = level; 
    element.style.filter = "alpha(opacity=" + (level * 100) + ");"; 
} 

var duration = 300; /* 1000 millisecond fade = 1 sec */ 
var steps = 10;  /* number of opacity intervals */ 
var delay = 6000;  /* 5 sec delay before fading out */ 

function fadeIn(){ 
    for (i = 0; i <= 1; i += (1/steps)) { 
    setTimeout("setOpacity(" + i + ")", i * duration); 
    } 
// setTimeout("fadeOut()", delay); 
} 

function fadeOut() { 
    for (i = 0; i <= 1; i += (1/steps)) { 
    setTimeout("setOpacity(" + (1 - i) + ")", i * duration); 
    } 
    setTimeout("fadeIn()", duration); 
} 

// 끝을 따를

내 스크립트는 여기서 추가 :

그것을 작동합니다 그래서
$('#slideshow').cycle({ 
    cleartype: 1 // enable cleartype corrections 
}); 

or 

$('#fadingElement').fadeIn(2000, function(){ 
$(this).css('filter',''); 
}); 

... 제발 도와주세요 ...

+0

정말 ....... – Chandu

+0

페이지에이 링크 포함 http://www.microsoft.com/typography/cleartype/tuner/tune.aspx –

+0

사용자가 창을 강제로 편집 할 수 없습니다. 설정. – Chetan

답변

0

이것은 쉽습니다. 모든 텍스트를 미리 렌더링 된 버전으로 바꾸십시오. 사이트의 너비가 고정 된 레이아웃 인 경우 해당 사이트의 스크린 샷을 찍어 이미지를 페이지에 삽입하십시오. 미리 렌더링 된 이미지를 사용하는 것은 항상 명확하고 명확한 솔루션입니다.