62f8641de9ee59abb37c25e10d3cad7835e32904.svn-base 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327
  1. <%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
  2. <%
  3. String path = request.getContextPath();
  4. %>
  5. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  6. <html xmlns="http://www.w3.org/1999/xhtml">
  7. <head>
  8. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  9. <title></title>
  10. <!--框架必需start-->
  11. <script type="text/javascript" src="<%=path%>/libs/js/jquery.js"></script>
  12. <script type="text/javascript" src="<%=path%>/libs/js/language/cn.js"></script>
  13. <script type="text/javascript" src="<%=path%>/libs/js/framework.js"></script>
  14. <link href="<%=path%>/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
  15. <link rel="stylesheet" type="text/css" id="skin" prePath="<%=path%>/"/>
  16. <link rel="stylesheet" type="text/css" id="customSkin"/>
  17. <!--框架必需end-->
  18. <!--基本选项卡start-->
  19. <script type="text/javascript" src="<%=path%>/libs/js/nav/basicTab.js"></script>
  20. <!--基本选项卡end-->
  21. </head>
  22. <body>
  23. <div class="box1" panelWidth="850">
  24. <fieldset>
  25. <legend>1、非iframe模式-基本使用</legend>
  26. <div class="basicTab">
  27. <div name="选项1" style="width:760px;height:240px;">
  28. 内容1<br />内容1
  29. </div>
  30. <div name="选项2" style="width:760px;height:240px;">
  31. 内容2<br />内容2
  32. </div>
  33. <div name="选项3" style="width:760px;height:240px;">
  34. 内容3<br />内容3
  35. </div>
  36. <div name="选项4" style="width:760px;height:240px;">
  37. 内容4<br />内容4
  38. </div>
  39. </div>
  40. </fieldset>
  41. <div class="height_15"></div>
  42. <fieldset>
  43. <legend>2、非iframe模式-设定初始选中索引</legend>
  44. <div class="basicTab" selectedIdx="1">
  45. <div name="选项1" style="width:760px;height:240px;">
  46. 内容1<br />内容1
  47. </div>
  48. <div name="选项2" style="width:760px;height:240px;">
  49. 内容2<br />内容2
  50. </div>
  51. <div name="选项3" style="width:760px;height:240px;">
  52. 内容3<br />内容3
  53. </div>
  54. <div name="选项4" style="width:760px;height:240px;">
  55. 内容4<br />内容4
  56. </div>
  57. </div>
  58. </fieldset>
  59. <div class="height_15"></div>
  60. <fieldset>
  61. <legend>3、非iframe模式-禁止点击并由外部控制索引</legend>
  62. 禁用全部选项卡:
  63. <div class="basicTab" allItemDisabled="true" id="basicTab-3-1">
  64. <div name="步骤1" style="width:760px;height:240px;">
  65. 内容1<br />内容1
  66. </div>
  67. <div name="步骤2" style="width:760px;height:240px;">
  68. 内容2<br />内容2
  69. </div>
  70. <div name="步骤3" style="width:760px;height:240px;">
  71. 内容3<br />内容3
  72. </div>
  73. <div name="步骤4" style="width:760px;height:240px;">
  74. 内容4<br />内容4
  75. </div>
  76. </div>
  77. <input type="button" value="改变索引" onclick="changeIdxHandler()"/>
  78. <br/><br/>
  79. 禁用部分选项卡:
  80. <div class="basicTab" id="basicTab-3-2">
  81. <div name="步骤1" style="width:760px;height:240px;">
  82. 内容1<br />内容1
  83. </div>
  84. <div name="步骤2" style="width:760px;height:240px;">
  85. 内容2<br />内容2
  86. </div>
  87. <div name="步骤3" style="width:760px;height:240px;" itemDisabled="true">
  88. 内容3<br />内容3
  89. </div>
  90. <div name="步骤4" style="width:760px;height:240px;" itemDisabled="true">
  91. 内容4<br />内容4
  92. </div>
  93. </div>
  94. <input type="button" value="启用“步骤3”" onclick="enableTabHandler()"/>
  95. <input type="button" value="禁用“步骤3”" onclick="disableTabHandler()"/>
  96. </fieldset>
  97. <div class="height_15"></div>
  98. <fieldset>
  99. <legend>4、iframe模式-基本使用</legend>
  100. <div class="basicTab" iframeMode="true" data='{"list":[{"name":"选项1","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"选项2","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"}]}'>
  101. <div style="width:760px;height:240px;">
  102. <IFRAME width="100%" height="100%" frameBorder=0 allowTransparency="true" name="iframeChild1" id="iframeChild1"></IFRAME>
  103. </div>
  104. </div>
  105. </fieldset>
  106. <div class="height_15"></div>
  107. <fieldset>
  108. <legend>5、iframe模式-设定初始选中索引</legend>
  109. <div class="basicTab" iframeMode="true" selectedIdx="1" data='{"list":[{"name":"选项1","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"选项2","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"}]}'>
  110. <div style="width:760px;;height:240px;">
  111. <IFRAME width="100%" height="100%" frameBorder=0 allowTransparency="true" name="iframeChild12 id="iframeChild2"></IFRAME>
  112. </div>
  113. </div>
  114. </fieldset>
  115. <div class="height_15"></div>
  116. <fieldset>
  117. <legend>6、iframe模式-禁止点击并由外部控制索引</legend>
  118. 禁用全部选项卡:
  119. <div class="basicTab" iframeMode="true" id="basicTab-6-1" allItemDisabled="true" data='{"list":[{"name":"步骤1","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"步骤2","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"},{"name":"步骤3","url":"<%=path%>/sample/nav/tab-basic-content3.jsp"}]}'>
  120. <div style="width:760px;;height:240px;">
  121. <IFRAME width="100%" height="100%" frameBorder=0 allowTransparency="true" name="iframeChild3" id="iframeChild3"></IFRAME>
  122. </div>
  123. </div>
  124. <input type="button" value="改变索引" onclick="changeIdxHandler2()"/>
  125. <br/><br/>
  126. 禁用部分选项卡:
  127. <div class="basicTab" iframeMode="true" id="basicTab-6-2" data='{"list":[{"name":"步骤1","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"步骤2","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"},{"name":"步骤3","url":"<%=path%>/sample/nav/tab-basic-content3.jsp","itemDisabled":"true"}]}'>
  128. <div style="width:760px;;height:240px;">
  129. <IFRAME width="100%" height="100%" frameBorder=0 allowTransparency="true" name="iframeChild4" id="iframeChild4"></IFRAME>
  130. </div>
  131. </div>
  132. <input type="button" value="启用“步骤3”" onclick="enableTabHandler2()"/>
  133. <input type="button" value="禁用“步骤3”" onclick="disableTabHandler2()"/>
  134. </fieldset>
  135. <div class="height_15"></div>
  136. <fieldset>
  137. <legend>7、iframe模式-切换标签式出现进度条</legend>
  138. <div class="basicTab" iframeMode="true" showProgress="true" data='{"list":[{"name":"选项1","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"选项2","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"}]}'>
  139. <div style="width:760px;;height:240px;">
  140. <IFRAME width="100%" height="100%" frameBorder=0 allowTransparency="true" name="iframeChild5" id="iframeChild5"></IFRAME>
  141. </div>
  142. </div>
  143. </fieldset>
  144. <div class="height_15"></div>
  145. <fieldset>
  146. <legend>8、自定义内容区样式</legend>
  147. <div class="basicTab" iframeMode="true" data='{"list":[{"name":"选项1","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"选项2","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"}]}'>
  148. <div style="width:98%;border:none;border-top:solid 2px #5ba2fc;">
  149. <IFRAME width="100%" height="100%" frameBorder=0 allowTransparency="true" name="iframeChild6" id="iframeChild6"></IFRAME>
  150. </div>
  151. </div>
  152. </fieldset>
  153. <div class="height_15"></div>
  154. <fieldset>
  155. <legend>9、选项卡点击事件</legend>
  156. <div class="basicTab" id="tab-9">
  157. <div name="选项1" style="width:760px;height:240px;">
  158. 内容1<br />内容1
  159. </div>
  160. <div name="选项2" style="width:760px;height:240px;">
  161. 内容2<br />内容2
  162. </div>
  163. </div>
  164. </fieldset>
  165. <div class="height_15"></div>
  166. <fieldset>
  167. <legend>10、获取当前选中索引</legend>
  168. <div class="basicTab" id="tab-10">
  169. <div name="选项1" style="width:760px;height:240px;">
  170. 内容1<br />内容1
  171. </div>
  172. <div name="选项2" style="width:760px;height:240px;">
  173. 内容2<br />内容2
  174. </div>
  175. </div>
  176. <input type="button" value="获取当前索引" onclick="getTabValue()"/>
  177. </fieldset>
  178. <div class="height_15"></div>
  179. <fieldset>
  180. <legend>11、鼠标移入切换标签</legend>
  181. <div class="basicTab" hoverMode="true">
  182. <div name="选项1" style="width:760px;height:240px;">
  183. 内容1<br />内容1
  184. </div>
  185. <div name="选项2" style="width:760px;height:240px;">
  186. 内容2<br />内容2
  187. </div>
  188. <div name="选项3" style="width:760px;height:240px;">
  189. 内容3<br />内容3
  190. </div>
  191. <div name="选项4" style="width:760px;height:240px;">
  192. 内容4<br />内容4
  193. </div>
  194. </div>
  195. </fieldset>
  196. <div class="height_15"></div>
  197. <fieldset>
  198. <legend>12、单内容区域模式</legend>
  199. <div class="basicTab" id="tab-12" singleContentMode="true" data='{"list":[{"name":"选项1"},{"name":"选项2"},{"name":"选项3"}]}'>
  200. <div style="width:760px;height:240px;" id="tab-12-content">
  201. 内容1<br />内容1
  202. </div>
  203. </div>
  204. </fieldset>
  205. <div class="height_15"></div>
  206. <fieldset>
  207. <legend>13、tab过多左右滚动</legend>
  208. 非iframe模式
  209. <div class="basicTab" tabScroll="true">
  210. <div name="标题文字内容1" style="width:780px;height:240px;">
  211. 内容1<br />内容1
  212. </div>
  213. <div name="标题文字内容2" style="width:780px;height:240px;">
  214. 内容2<br />内容2
  215. </div>
  216. <div name="标题文字内容3" style="width:780px;height:240px;">
  217. 内容3<br />内容3
  218. </div>
  219. <div name="标题文字内容4" style="width:780px;height:240px;">
  220. 内容4<br />内容4
  221. </div>
  222. <div name="标题文字内容5" style="width:780px;height:240px;">
  223. 内容5<br />内容5
  224. </div>
  225. <div name="标题文字内容6" style="width:780px;height:240px;">
  226. 内容6<br />内容6
  227. </div>
  228. <div name="标题文字内容7" style="width:780px;height:240px;">
  229. 内容7<br />内容7
  230. </div>
  231. </div>
  232. <br/><br/>
  233. iframe模式
  234. <div class="basicTab" iframeMode="true" tabScroll="true" data='{"list":[{"name":"标题文字内容1","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"标题文字内容2","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"},{"name":"标题文字内容3","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"标题文字内容4","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"},{"name":"标题文字内容5","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"},{"name":"标题文字内容6","url":"<%=path%>/sample/nav/tab-basic-content2.jsp"},{"name":"标题文字内容7","url":"<%=path%>/sample/nav/tab-basic-content1.jsp"}]}'>
  235. <div style="width:780px;;height:240px;">
  236. <IFRAME width="100%" height="100%" frameBorder=0 allowTransparency="true" name="iframeChild7" id="iframeChild7"></IFRAME>
  237. </div>
  238. </div>
  239. </fieldset>
  240. <div style="height:200px;"></div>
  241. </div>
  242. </body>
  243. <script>
  244. function initComplete(){
  245. $("#tab-9").bind("actived",function(e,i){
  246. alert(i);
  247. })
  248. $("#tab-12").bind("actived",function(e,i){
  249. if(i==0){
  250. $("#tab-12-content").html('内容1<br />内容1');
  251. }
  252. else if(i==1){
  253. $("#tab-12-content").html('内容2<br />内容2');
  254. }
  255. else if(i==2){
  256. $("#tab-12-content").html('内容3<br />内容3');
  257. }
  258. })
  259. }
  260. //外部控制索引
  261. var idx=0;
  262. function changeIdxHandler(){
  263. idx++
  264. if(idx>3){
  265. idx=0;
  266. }
  267. $("#basicTab-3-1").basicTabSetIdx(idx);
  268. }
  269. //启用
  270. function enableTabHandler(){
  271. $("#basicTab-3-2").basicTabSetEnable(2,true);
  272. }
  273. //禁用
  274. function disableTabHandler(){
  275. $("#basicTab-3-2").basicTabSetEnable(2,false);
  276. }
  277. var idx2=0;
  278. function changeIdxHandler2(){
  279. idx2++
  280. if(idx2>2){
  281. idx2=0;
  282. }
  283. $("#basicTab-6-1").basicTabSetIdx(idx2);
  284. }
  285. //动态禁用或启用
  286. function enableTabHandler2(){
  287. $("#basicTab-6-2").basicTabSetEnable(2,true);
  288. }
  289. function disableTabHandler2(){
  290. $("#basicTab-6-2").basicTabSetEnable(2,false);
  291. }
  292. //获得选中索引
  293. function getTabValue(){
  294. alert($("#tab-10").attr("selectedIdx"));
  295. }
  296. </script>
  297. </html>