更好的替代 iframe 来显示标签内容? [英] Better alternative to an iframe to display tab content?

查看:62
本文介绍了更好的替代 iframe 来显示标签内容?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 iframe 的页面,用于显示所单击选项卡的内容.有 3 个标签和 1 个 iframe.与点击的每个标签相关的内容的来源被格式化和编码在其他 html &css 文件.

使用 iframe 的另一种选择是什么,因为我注意到在单击选项卡时,它仍然显示白色背景,类似于加载新页面时?

这是我的代码:

<div id="概览"><a target="tabsa" class="imagelink lookA" href="toframe.html">概览</a>

<div id="画廊"><a target="tabsa" class="imagelink lookA" href="tawagpinoygallery.html">画廊</a>

<div id="评论"><a target="tabsa" class="imagelink lookA" href="trframe.html">评论</a>

<div id="tabs-1"><iframe src="toframe.html" name="tabsa" width="95%" height="100%" frameborder="0"></iframe>

解决方案

使用 IFRAME 加载动态内容(在页面加载后)的唯一替代方法是使用 AJAX 更新网页上的容器.它非常优雅,而且通常比将整个页面结构加载到 IFRAME 中更快.

I have a page with an iframe to feature the contents of the clicked tab. There are 3 tabs and 1 iframe. The sources of the contents relating to each tab clicked are formatted and coded in other html & css files.

What is another alternative to using an iframe, because I noticed that when the tab is clicked, it still shows the white background, similar to when a new page is loading?

Here's my code:

<div id="tabs">
<div id="overview">
  <a target="tabsa" class="imagelink lookA" href="toframe.html">Overviews</a>
</div>
<div id="gallery">
  <a target="tabsa" class="imagelink lookA" href="tawagpinoygallery.html">Gallery</a>
</div>
<div id="reviews">
  <a target="tabsa" class="imagelink lookA" href="trframe.html">Reviews</a>
</div>
</div>

<div id="tabs-1">
  <iframe src="toframe.html" name= "tabsa" width="95%" height="100%" frameborder="0">
  </iframe>
</div>

解决方案

The only alternative to using IFRAMEs to load dynamic content (after the page has loaded) is using AJAX to update a container on your web page. It's pretty elegant and usually faster than loading a full page structure into an IFRAME.

这篇关于更好的替代 iframe 来显示标签内容?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
前端开发最新文章
热门教程
热门工具
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆