가로 스크롤 배너 (marquee)
카테고리 없음 2018. 7. 13. 19:45 |가로 스크롤 배너 (marquee)
ajax 로딩된 페이지 내에서만, 링크걸기
1. onclick="location.href='#'" 형태의 링크걸기
<script>
$(document).ready(function(){
$('.t_ok').bind('click', function(e) {
var url = $(this).data('url');
$('#rightwrap').load(url); // load the html response into a DOM element
e.preventDefault(); // stop the browser from following the link
});
});
</script>
<li class="t_ok" data-url="./sum_right.asp?d_cd=10">링크</li>
2. a 태그에 바로 링크걸기
<script>
$(document).ready(function(){
$('a.t_ok').bind('click', function(e) {
var url = $(this).attr('url');
$('#rightwrap').load(url); // load the html response into a DOM element
e.preventDefault(); // stop the browser from following the link
});
});
</script>
<li><a href="./sum_right.asp?d_cd=10" class="t_ok">링크</a></li>
<div id="rightwrap"></div>