/    Sign up×
Community /Pin to ProfileBookmark

is it possible with Javascript

Hello I was wondering if this is possible with Javascript

I created a services page with buttons on them, I want when the user clicks on one of the buttons for the rest to fade out. The selected one move to the left and have the description text appear. Is this possible. Sort of like in flash i would do a tween left and fade out the rest and have another movie clip appear with the text inside. Any help would be appreciated THanks!

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@apegApr 14.2010 — Sure can, i would go with jQuery, it will make your life much easier...

Here is a quick example, you're probably going to want to play around with the fading and sliding transitions. but its a good start:

[CODE] <style type="text/css">
.button {
float:left;
}
</style>
<script>
$(document).ready(function(){
$('.button').click(function () {
$(this).siblings('.button').fadeOut('slow');
$('#words').html('some new message!');
});
});
</script>
<button class='button'>button_1</button>
<button class='button'>button_2</button>
<button class='button'>button_3</button>
<button class='button'>button_4</button>
<span id='words'>
</span> [/CODE]


-aPeg
Copy linkTweet thisAlerts:
@nicu420nicuauthorApr 14.2010 — awesome i'm gonna check it out thanks a lot
×

Success!

Help @nicu420nicu 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 5.22,
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: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

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

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...