Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Close buttons on tabs #518
I'm trying to implement tabs (actually pills in my case, with less rounding, as the styling is closer to what I want) with a close button to the right, similar to browser tabs. This should be added to Twitter Bootstrap as an option.
Extending current code to do this isn't as clean/easy as it should be because the pill color is on the
Here's how I was able to get this working. I wrapped one anchor around a bootstrap icon (i tag) and the text of the tab... Then I added a click handler to the anchor and one to the (i tag) - in the (i tag) click handler i return false - which stops the event.
I came up with a pretty short solution for adding close buttons to tabs (the non-pill type):
referenced this issue
Sep 20, 2012
I created a dropselect pill/tab.. and appended a close(hide/ fadeout /??) to all the links.. i made this dropselect pill/tab first in the row of pills/tabs.
onselect i run the close function with tab id..
I dynamically create my tabs in a popup window, so i cant post the correct code for YOU! here.. But the idea is very standard..
Hope this helps someone.