이미지에 텍스트를 하나씩 표시합니다. 그래서 각 줄에는 <BR>
태그가 있지만 jquery를 사용하여 이미지에 텍스트가 표시되면 BR이 제대로 번역되지 않고 오히려 빈 공간이 페이지 맨 위에 오게됩니다. 여기 내 스크립트새 줄 문자가 jquery에 의해 올바르게 렌더링되지 않습니다.
<div id="HeaderMessage" class="HeaderMsg1">
<span class="HeaderMsg">A LIFETIME WARRANTY FOR EVERY PART WE REMANUFACTURE.<br/>We reengineer the faults out of parts so they won't fail again. Guaranteed.</span>
<span class="HeaderMsg">PROFIT FROM ENGINEERING EXPERTISE.<br/>We offer you reliable parts, low prices and easy access to automotive knowledge.</span>
<span class="HeaderMsg">JOIN US FOR A CAREER THAT CAN TAKE YOU FURTHER, FASTER. <br/>Reengineer your future with a world leader in the remanufacture of electronic automotive parts.</span>
<span class="HeaderMsg">THE SENSIBLE CHOICE IS THE GREENER CHOICE TOO.<br/>Our parts save precious raw materials, reduce automotive waste and require less CO2 to produce. </span>
</div>
$('.HeaderMsg1 span:gt(0)').hide();
setInterval(function() {
$('.HeaderMsg1 :first-child').fadeOut()
.next('span').fadeIn()
.end().appendTo('.HeaderMsg1');
}, 5000);
입니다. 도와주세요. 감사합니다
경우 해당 클래스가 블록으로 표시하고 그에게 약간의 크기와 패딩을주는 일부 CSS를 추가해야합니다. 그것은 귀하의 설명에 근거하여 문제가 무엇인지, 또는 가지고있는 바가 무엇인지 모르겠습니다. – SpaceBison
귀하의 Doctype에 따라 귀하의 '
'이 제대로 작동하지 않을 수 있습니다.
'. 또는 @SpaceBison이 말한 것과 훨씬 더 깨끗한 방법 인 CSS를 사용하십시오. – Chris
@Chris - 공백없이
에 문제가 없어야합니다. – SpaceBison