tabs 自适应
我现在需要做一个tabs栏,该tabs需要根据窗口的宽度来自适应,当窗口大小改变时,需要让tabs自动出现左右滚动条。在IE7下正常,但在IE6和FF3.6中不正常。
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>jQuery EasyUI</title>
<link rel="stylesheet" type="text/css" href="../themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="../themes/icon.css">
<script type="text/javascript" src="../jquery-1.4.2.min.js"></script>
<script type="text/javascript" src="../jquery.easyui.min.js"></script>
<script>
var index = 0;
function addTab(){
index++;
$('#tt').tabs('add',{
title:'New Tab ' + index,
content:'Tab Body ' + index,
closable:true
});
}
$(window).resize(function(){
$('#tt').tabs('resize');
});
</script>
</head>
<body>
<h1>Tabs</h1>
<div>
<a class="easyui-linkbutton" icon="icon-add" href="javascript:void(0)" onclick="addTab()">add tab</a>
</div>
<br/>
<div id="tt" class="easyui-tabs" >
<div title="Tab1" style="padding:20px;display:none;">
</div>
</div>
</body>
</html>