jQuery .html (여기 데이터)는 응답 텍스트를 "크기로"하는 것 같습니다.
문제
다음 코드를 고려하십시오.
ID라는 앵커 태그입니다 리더 모듈-토탈 눌렀을 때 - PHP 스크립트를 호출하고 PHP 코드에서 수행 된 Echos를 호출 한 ID 안에 표시합니다. 리더 모듈.
기본적으로.
그러나이 작업을 수행 할 때 마다이 스 니펫의 마지막 코드를 사용하여 "수축"해야합니다.
내 질문은 어떻게 되나요? 내가 여기서 뭔가 잘못하고 있는가?
$('#leader-module-total').click(function() {
//load an image to show while processing
$('#leader-module').html( '<div class="ajaxLoader"></div>' );
//process the php script -- btw, is this valid i.e. calling it using /
//and not fully qualified with http://mydomain/page-to-be-called
$.get('/ajax-leader-module-response.php', { timeframe: 'total' },
function(data){
$('#leader-module').html( data );
}
);
//this is my question: why is this necessary???
//I need to make it smaller than it was for it to display normally.
$('#leader-module').css('font-size', '0.9333em');
return false;
});
해결책
부모 태그에서 스타일을 상속하는 것 같아요. 글꼴 크기 스타일에 대해서는 상위 요소를 확인하십시오.
제휴하지 않습니다 StackOverflow