473,386 Members | 1,720 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

how to add close button tab header.

i need know how to add close button to tab header
Jun 12 '13 #1
2 3472
Dormilich
8,658 Expert Mod 8TB
a self-defined tab or the browser’s tab?

the former just needs to call window.close() the latter is not possible.
Jun 12 '13 #2
Sherin
77 64KB
Try This Code

Expand|Select|Wrap|Line Numbers
  1. <html lang="en">
  2. <head>
  3.   <meta charset="utf-8" />
  4.   <title>jQuery UI Tabs - Default functionality</title>
  5.   <link rel="stylesheet" href="http://code.jquery.com/ui/1.10.0/themes/base/jquery-ui.css" />
  6.   <script src="http://code.jquery.com/jquery-1.8.3.js"></script>
  7.   <script src="http://code.jquery.com/ui/1.10.0/jquery-ui.js"></script>
  8.   <script>
  9.   $(function() {
  10.     $( "#tabs" ).tabs();
  11.     $(".ui-closable-tab").live( "click", function() {
  12.         var tabContainerDiv=$(this).closest(".ui-tabs").attr("id");
  13.         var panelId = $( this ).closest( "li" ).remove().attr( "aria-controls" );
  14.         $( "#" + panelId ).remove();
  15.         $("#"+tabContainerDiv).tabs("refresh");
  16.         var tabCount=$("#"+tabContainerDiv).find(".ui-closable-tab").length;
  17.         if (tabCount<1) {
  18.             $("#"+tabContainerDiv).hide();
  19.         }
  20.     });
  21.   });
  22.   </script>
  23.   <style>
  24.   .ui-icon-circle-close {
  25.     cursor:pointer;
  26.   }
  27.   </style>
  28. </head>
  29. <body>
  30.  
  31. <div id="tabs">
  32.   <ul>
  33.     <li><a href="#tabs-1">Nunc tincidunt</a><span class='ui-icon ui-icon-circle-close ui-closable-tab'></span></li>
  34.     <li><a href="#tabs-2">Proin dolor</a><span class='ui-icon ui-icon-circle-close ui-closable-tab'></span></li>
  35.     <li><a href="#tabs-3">Aenean lacinia</a><span class='ui-icon ui-icon-circle-close ui-closable-tab'></span></li>
  36.   </ul>
  37.   <div id="tabs-1">
  38.     <p>Tab 1 Content</p>
  39.   </div>
  40.   <div id="tabs-2">
  41.     <p>Tab 2 Content</p>
  42.   </div>
  43.   <div id="tabs-3">
  44.     <p>Tab 3 Content</p>
  45.   </div>
  46. </div>
  47. </body>
  48. </html>
Dec 7 '20 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: andrewkooi | last post by:
Greetings, I do not know whether such code exist but no harm asking: Is it possible for me to make visible a close button if the active window is a popup window or a new window (other than the...
4
by: moose | last post by:
OK Popup window? No problem PDF in popup? No problem But what about a couple of Close Window buttons? Imagine a "Close Window" button at the top of the popup page. Then the PDF which can...
5
by: Nick250 | last post by:
I have a simple app that I created for our Real Estate office using Access 2000 and it is working fine except for on thing. I need to keep the close button hidden from the users. No problem...
5
by: Reggie | last post by:
Hi and TIA! I have a form and have set the Close Button to false so that users must exit using my close button. However when I open a Report from this form I want the close button to be available...
2
by: David | last post by:
Is there anyway to get a different DialogResult or detect that the user clicked the close button on a MessageBox? I have a message box that pops up when my program first starts that only has an ok...
4
by: mhifd009 | last post by:
I have disabled a close button in the property section of a form (FRM1), as i open the form the close button has gone (i have programmed close button), but as i close the form, the form that opened...
1
by: somtabu | last post by:
hello, i have a problem in vb.net windows application, verson is 2005 and framework is 2.0 I want to close a form by using the close button which is right hand top side of the window. i want,...
2
by: Bruce | last post by:
Hello, I have a form in an Access 2003 application which opens maximized. Its CloseButton property is set to false. On this form I have a command button that opens a report in preview mode. ...
0
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
5
by: Tony | last post by:
I am continuing to develop an Access 2007 application which was originally converted from Access 2003. In Access 2003 I was able to disable the Access Close button in the top righthand corner of...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.