/    Sign up×
Community /Pin to ProfileBookmark

jQuery UI tabs (newbie)

Hi all,

I am using jQuery UI tabs with an unordered list like this:

[CODE]<div id=”jqueryui-tabs-wrapper”>
<div id=”tabs-x”>
<ul id=”tab-list”>
<li><a href=”#first-tab”>First Tab<a/></li>
<li><a href=”#second-tab”>Second Tab<a/></li>
<li><a href=”#third-tab”>Third Tab<a/></li>
</ul><!–end tab list–>

<div id=”tab-content”>

<div id=”first-tab”>
Content for the first tab
</div>

<div id=”second-tab”>
Content for the second tab
</div>

<div id=”third-tab”>
Content for the third tab
</div>

</div><!– end tab content–>

</div><!– end tabs-x–>

</div><!– end jquery-ui-tabs-wrapper–>[/CODE]

Can anyone please tell me the syntax for “when I click on the heading “tab 2″ do something to the content of tab 2” ie something like this:

[CODE](function ($) {
$(document).ready(function(){
$(“#jquery-click-test”).click(function(){
$(“#jquery-click-test”).css({“background-color”:”red”,”border”:”6px solid green”});
});
});
})(jQuery);[/CODE]

Thanks…

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@rootJul 01.2014 — Try asking in the frameworks (JQuery) forum
×

Success!

Help @Juc1 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.16,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...