好的,我一直在尝试研究如何做到这一点并且失败了。我认为使用 Jquery replaceWith 是可能的,但不知道如何实现它。
基本上我有这些导航图标:
<li><a href="#navclose" class="open"><span>MAINSTREAM</span><img src="images/stacks/mainstream.png" alt="MAINSTREAM" /></a></li>
<li><a href=""><span>THOUGHT MENU</span><img src="images/stacks/thoughtmenu.png" alt="THOUGHTMENU" /></a></li>
<li><a href="#"><span>Redrawing the Maps</span><img src="images/stacks/redrawnmaps.png" alt="Photoshop" /></a></li>
单击每个图标时,我希望它更改信息(将网页加载到主 iframe 内容中),我要更改的项目是 URL 'http://www.redrawingthemaps.org.uk/' 和日期信息' 2012 年 6 月在这里发起:
<div id="navclose">
<div id="navfunction" >
<div id="searchbar"><ul class="navfunction2">
<li>http://www.redrawingthemaps.org.uk/</li>
</ul></div>
<ul class="navfunction">
<li style="margin-right:-2px;"><a href="#navclose" class="close">Close</a></li>
<li><a href="http://www.redrawingthemaps.org.uk/" target="_blank">Open In New Window</a> </li>
<li>Initiated June 2012</li>
</ul>
</div>
<div id="navcontent"><iframe src="http://www.redrawingthemaps.org.uk/" width="1000px" height="3000px" frameborder="0"></iframe></div>
</div>
<script>
$(function() {
$('a.open').click(function() {
$($(this).attr('href')).slideDown(500);
return true;
});
$(function() {
$('a.close').click(function() {
$($(this).attr('href')).slideUp(500);
return false;
});});
});});
</script>