문제가 jquery의로드 기능 또는 jquery의 탭 (또는 해당 없음)과 관련이 있는지 알 수 없지만 tab2에서 tab1 (아래 코드 참조)로 전환 할 때 탭 콘텐츠가 지워지고 다시로드되어 깜박 거립니다. 데이터는 load 함수를 통해 tab1의 단락 요소 (id : the_paragraph)에 동적으로로드됩니다. tab1에서 tab2로 전환 할 때 문제가 발생하지 않습니다.탭을 전환 할 때 Jquery가 깜박임
재생할 때 : http://mumka12345.appspot.com/으로 이동하고 마우스를 Tab2로 이동 한 다음 Tab1로 돌아갑니다. 문제를 강조하기 위해 2 개의 경고를 배치했습니다.
이 서버가 'TAB1'요청할 때 다음과 같은 반환이 탭
<!DOCTYPE html>
<html>
<head>
<link href="http://ajax.googleapis.com/ajax/libs/jqueryui/1/themes/base/jquery-ui.css" rel="stylesheet" type="text/css"/>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js'></script>
<script>
$(document).ready(function()
{
$("#tabs").tabs({
load: function(event, ui)
{
$(ui.panel).delegate('a', 'click', function(event)
{
$(ui.panel).load(this.href);
event.preventDefault();
});
},
event: "mouseover"
});
});
</script>
</head>
<body style="font-size:62.5%;">
<div id="tabs">
<ul>
<li><a href="/tab1"><span>tab1</span></a></li>
<li><a href="/tab2"><span>tab2</span></a></li>
</ul>
</div>
</body>
</html>
을 가지고 내 메인 페이지입니다 :
<!DOCTYPE html>
<html>
<head>
<script src='http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js'></script>
<script src='http://ajax.googleapis.com/ajax/libs/jqueryui/1/jquery-ui.min.js'></script>
<script>
$(function()
{
alert('ready');
$("#the_paragraph").load("/fillParagraph" , function()
{
alert('paragraph loaded');
});
});
</script>
</head>'
<body">
<div id="container">
<p id="the_paragraph">
</p>
</body>
</html>
서버가 문자열 '안녕하세요 TAB2를'클라이언트 반환을 reques 'tab2' 클라이언트가 'fillParagraph'를 요청하면 서버가 'Dynamic Fill'문자열을 반환합니다.
빠른 응답을 보내 주셔서 감사합니다. 그러나 경고는 아무 관련이 없습니다. –
경고 제안은 작업 흐름을 좀 더 쉽게하기위한 것입니다. 내 대답은 jQuery 및 jQuery UI 다시로드에 관한 것이 었습니다. 응답에서 반환 된 페이지에서 원하는 내용을 다시로드 할 수 있습니다. 왜 처음으로 콘텐츠를 반환하지 않습니까? – Mattyod