if (Google & Bing)의 두 항목을 한 번 클릭하면 iframe을 만들었고 검색을 수행 할 수 있습니다.iframe이없는 경우 jquery load
이제 li을 다시 클릭하여 iframe이 이미 있는지 확인하여 검색을 다시로드하지 않으면 어떻게됩니까? 그게 의미가 있습니까?
<HTML>
<HEAD>
<TITLE></TITLE>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.min.js "></script>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.js "></script>
<style type="text/css">
iframe {width: 100%;height: 100%;max-width: 850px;min-height: 890px;overflow-x: hidden;overflow-y: auto;}
</style>
</HEAD>
<body>
<div id="search_engines" class="tabs">
<ul>
<li><a href="#google" onclick="googleLoad();">Google</a></li>
<li><a href="#bing" onclick="bingLoad();">Bing</a></li>
</ul>
<div id="google">
<a href="javascript: void(0)" onclick="googleLoad();" style="text-decoration: none" class="">New search</a>
<script type="text/javascript">
function googleLoad() {
$("#googleIframe").html('<iframe id="googleLoad" frameborder="0" src="http:www.google.com"></iframe>');
}
</script>
<div id="googleIframe">
<!--Iframe goes here -->
</div>
</div>
<div id="bing">
<a href="javascript: void(0)" onclick="bingLoad();" style="text-decoration: none" class="">New search</a>
<script type="text/javascript">
function bingLoad() {
$("#bingIframe").html('<iframe id="bingLoad" frameborder="0" src="http:www.bing.com"></iframe>');
}
</script>
<div id="bingIframe">
<!--Iframe goes here -->
</div>
</div>
</div>
</body>
</HTML>
사실이 답변을 더 좋아합니다. .one 방법에 대해 몰랐습니다. +1 –
@InfernalBadger ~ 일주일 전에 나도 그랬어. : D –
구체적인 예를 들어 주시겠습니까? – user472285