ext TabPanel学习(1)

效果图:

[img]http://dl2.iteye.com/upload/attachment/0087/3572/9a8554ae-eae1-31e2-b66c-75648863e966.png[/img]


js代码:
Ext.onReady(function(){
    var tabDemo = new Ext.TabPanel({
        renderTo:Ext.getBody(),
        width:300,
        activeTab:0,//当前激活标签
        frame:true,
        closable:true,
        items:[{
                contentEl:'tabOne',//标签页的页面元素id
                title:'嘎嘎',
                closable:true//是否实现关闭按钮,默认false
               
            },{
                contentEl:'tabTwo',
                title:'你们好啊,小伙伴们',
                closable:true,
            }]
    })
})
html代码:
<body>
    <div>
        <div id="tabOne" class="x-hide-display">我是tabOne</div>
        <div id="tabTwo" class="x-hide-display">我是tabTwo</div>
    </div>
</body>



<!--注意class类型,设为x-hide-display,以正常显示-->
//几个相关参数
1.tabPosition:"bottom"//选项卡的位置,枚举值bottom,top.默认为top(只有top的时候才能选项卡的滚动!)
2.tabTip:"提示"//必须先调用Ext.QuickTips.init();才有效果


在一个选项卡中加载一个完整页面
使用iframe作为tab的标签页内容
效果图:

[img]http://dl2.iteye.com/upload/attachment/0087/3598/ee219b8a-d77e-3696-9b9f-72f91a572af1.png[/img]
点击连接-->"我的博客"

[img]http://dl2.iteye.com/upload/attachment/0087/3600/3545ee5e-9c46-3fb7-9a12-4732da0c9cc5.png[/img]

js代码如下:

Ext.onReady(function(){
    Ext.QuickTips.init();
    var tabDemo = new Ext.TabPanel({
        renderTo:Ext.getBody(),
        activeTab:0,
        height:700,//当用viewport布局时,height可以省去
        frame:true,
        items:[{
                contentEl:'mainFrame',
                title:'加载页面的标签页',
                closable:true
            }]
    })
})
html代码如下:
<body>
    <div>
        <a href="javascript:void(0)"
        οnclick="parent.frames['mainFrame'].location='http://wlxt-8436.iteye.com/'"
                >我的博客</a>
        <iframe id="mainFrame" name="mainFrame" src="http://www.163.com/"
                    frameborder='0' height='100%'
                width="100%" style="overflow:hidden"></iframe>
    </div>
</body>


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值