原创设计 · PhotoShop · AI/CD · Fireworks · AutoCAD · 3DMAX · Flash · 网页教学 · 高精图库 · 笔刷滤镜 · 矢量素材 · 图片素材 · 模板素材 · 会员相册
加入VIP,下载精美素材 · 原创设计欣赏第七期· QQ空间代码 · QQ空间代码 · QQ空间站· 非主流图片 · QQ头像 · 繁体字非主流图片 · QQ个性签名 · QQ空间播放器

2009年最新设计图书素材低价热销
设计优秀作品第九期/新手学习贴
加入VIP,即送3000缘分币,每月500
 下载素材,加入VIP,享受更多权限
发新话题
打印

[DW] 【求助】这个效果是怎么达到的,新手问题

【求助】这个效果是怎么达到的,新手问题

像思缘论坛,发表新话题时,在编辑框上的两个选项,discuz!代码模式和所见即所得模式,这两个是怎么得到相互转换的呢,而且不用刷新页面。
这个跟126邮箱的应该一样吧。像126邮箱里的如图,“今日”,“收件箱”,“文件夹”三个选项这间的转换的这种模式,不用刷新页面,急切希望得到答复,小弟先谢了

[ 本帖最后由 成话天下 于 2008-2-18 11:32 编辑 ]
附件: 您所在的用户组无法下载或查看附件




TOP

这个应该可以用IFRAME控件来实现.




TOP

This is CSS Tabs controled by Javascript
it is very easy.只需要用js控制style 的display属性即可
给你现成的代码
复制内容到剪贴板
代码:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>标签示例</title>
<style type="text/css">
body { font-size:14px; font-family:"宋体"}
ol li { margin:8px}
#con { font-size:12px; width:600px; margin:0 auto}
#tags { height:23px; width:400px; margin:0; padding:0; margin-left:10px}
#tags li { float:left; margin-right:1px; background:url(http://www.happyshow.org/sample/20061108/images/tagleft.gif) no-repeat left bottom; height:23px; list-style-type:none}
#tags li a { text-decoration:none; float:left; background:url(http://www.happyshow.org/sample/20061108/images/tagright.gif) no-repeat right bottom; height:23px; padding:0px 10px; line-height:23px; color:#999}
#tags li.emptyTag { width:4px; background:none}
#tags li.selectTag { background-position: left top; position:relative; height:25px; margin-bottom:-2px}
#tags li.selectTag a { background-position: right top; color:#000; height:25px; line-height:25px;}
#tagContent { padding:1px; background-color:#fff; border:1px solid #aecbd4;width:100%;}
.tagContent { background:url(http://www.happyshow.org/sample/20061108/images/bg.gif) repeat-x; height:350px;  padding:10px; color:#474747; width:576px; display:none}
#tagContent div.selectTag{ display:block}

.tagFrame{
background:url(http://www.happyshow.org/sample/20061108/images/bg.gif) repeat-x;
}

</style>
<SCRIPT LANGUAGE="JavaScript">
<!--
function getTab(flag) {  
  var elList, i;
  elList = document.getElementsByTagName("li");
  for (i = 0; i < elList.length; i++){
         elList[i].className ="";
  }
  elList[flag].className ="selectTag";
  elList[flag].blur();

}

function goto(flag){
        if("0"==flag){
                document.all.tabIframe.src="http://www.google.com";
        }else if("1"==flag){
                document.all.tabIframe.src="http://www.baidu.com";
        }else if("2"==flag){
                document.all.tabIframe.src="http://www.sogou.com";
        }
        getTab(parseInt(flag));
}
//-->
</SCRIPT>
</head>
<body>
<h1>标签示例</h1>

<div id="con">
  <ul id="tags">
    <li><a href="javascript:void(0)" onclick="goto('0');">标签一</a></li>
        <li class="selectTag"><a href="javascript:void(0)" onclick="goto('1');">标签二</a></li>
        <li><a href="javascript:void(0)" onclick="goto('2');">自适应宽度的标签</a></li>
  </ul>
  <div id="tagContent">
          <!-- <div id="tagContent0" class="tagContent">第一个标签的内容</div>
        <div id="tagContent1" class="tagContent selectTag">第二个标签的内容</div>
        <div id="tagContent2" class="tagContent">第三个标签的内容</div> -->
        <iframe class="tagFrame" name="tabIframe" src="http://www.google.com" marginheight="8" marginwidth="8" frameborder="0"  width="100%" height="100%"></iframe>
  </div>       
</div>
<script type="text/javascript">
function selectTag(showContent,url,selfObj){
        // 操作标签
        var tag = document.getElementById("tags").getElementsByTagName("li");
        var taglength = tag.length;
        for(i=0; i<taglength; i++){
                tag[i].className = "";
        }
        selfObj.parentNode.className = "selectTag";
       
}
</script>
</body>
</html>




TOP

好厉害~!




TOP

发新话题



关于本站 广告服务 联系我们 版权隐私 合作站点 网站地图 免责申明 管理团队

Powered by Discuz!6.0.0 Copyright © 2008 www.missyuan.com All rights reserved.