首页 > web前端 > js教程 > 正文

在你的网页中嵌入外部网页的方法_javascript技巧

php中文网
发布: 2016-05-16 19:16:04
原创
2469人浏览过

Description: Using a tabbed interface, this DHTML script lets you display external web pages inline on your page, with the help of the IFRAME tag. We threw in a feature that allows the user to also load the webpage in the entire browser window when desired. This script works in IE5+ and NS6+, and degrades well with the rest (as tabs are simply regular links). Cool! 
Step 1: Add the below CSS and DHTML script to the 

稿定在线PS
稿定在线PS

PS软件网页版

稿定在线PS 99
查看详情 稿定在线PS
 section of your page:
复制代码 代码如下:

 

<script> <br><br>/*********************************************** <BR>* Tabbed Document Viewer script- ? Dynamic Drive DHTML code library (www.dynamicdrive.com) <BR>* This notice MUST stay intact for legal use <BR>* Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code <BR>***********************************************/ <br><br>var selectedtablink="" <BR>var tcischecked=false <br><br>function handlelink(aobject){ <BR>selectedtablink=aobject.href <BR>tcischecked=(document.tabcontrol && document.tabcontrol.tabcheck.checked)? true : false <BR>if (document.getElementById && !tcischecked){ <BR>var tabobj=document.getElementById("tablist") <BR>var tabobjlinks=tabobj.getElementsByTagName("A") <BR>for (i=0; i<tabobjlinks.length; i++) <BR>tabobjlinks[i].className="" <BR>aobject.className="current" <BR>document.getElementById("tabiframe").src=selectedtablink <BR>return false <BR>} <BR>else <BR>return true <BR>} <br><br>function handleview(){ <BR>tcischecked=document.tabcontrol.tabcheck.checked <BR>if (document.getElementById && tcischecked){ <BR>if (selectedtablink!="") <BR>window.location=selectedtablink <BR>} <BR>} <br><br></script> 
To customize the look of the tabs (ie: color), edit the CSS. There is no need to modify the script at all.
Step 2: Add the below code to the  section of your page:
复制代码 代码如下:

 
 

 
 Open tab links in browser window instead. 
 
The above HTML code renders the tab links and IFRAME tag used to contain the external documents. Change the URLs to your own. Now, if you have lots of tab links, you can get them to appear on separate lines, by adding a divider:
复制代码 代码如下:

 
java速学教程(入门到精通)
java速学教程(入门到精通)

java怎么学习?java怎么入门?java在哪学?java怎么学才快?不用担心,这里为大家提供了java速学教程(入门到精通),有需要的小伙伴保存下载就能学习啦!

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号