Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

add text to header of jquery UI tab control

I would like to add some text to the header of a jquery UI tab control (see image). It would be good if I could align it on the right side.

enter image description here

like image 625
Preli Avatar asked Aug 30 '12 13:08

Preli


2 Answers

Something like this

$("#id_of_tab_element").tabs(); //init of your tabs element
var textElement = $("<span></span>");
textElement.text("text here...");

apply styles and append

textElement.css('position', 'absolute');
textElement.css('right', '20px');
$("#id_of_tab_element").append(textElement);

you could also define the styles in css and apply a class to the element

See this fiddle

like image 168
vearod Avatar answered Nov 14 '22 16:11

vearod


<ul class="ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all">
        <li class="ui-state-default ui-corner-top ui-tabs-selected ui-state-active"><a href="#tabs-1">Nunc tincidunt</a></li>
        <li class="ui-state-default ui-corner-top"><a href="#tabs-2">Proin dolor</a></li>
        <li class="ui-state-default ui-corner-top"><a href="#tabs-3">Aenean lacinia</a></li>
       <span style="float: right;">hello</span>
</ul>
like image 25
Sender Avatar answered Nov 14 '22 14:11

Sender