- 정보공유
[JQUERY] 확장성있는 글깜빡임 처리
<style>
.flash-text.on {color:red}
.flash-text.off {color:#000}
</style>
<script type="text/javascript">
jQuery(document).ready(function () {
setInterval('flash_text()', 1000);
});
function flash_text() {
$('.flash-text').each(
function() {
if ($(this).hasClass('on')) {
$(this).removeClass('on').addClass('off');
}
else {
$(this).removeClass('off').addClass('on');
}
}
);
}
</script>
<span class="flash-text">글자테스트</span>