/    Sign up×
Community /Pin to ProfileBookmark

change value onclick

Hi All

I was wondering if anyone could help me with code to change the id of the carousel onclick of a corresponding link, but i need the default carousel 0 to be shown on page load.

<?php wp_carousel([B]id i need to change[/B]); ?>

now the id can be = 0, 1, 2

and three links to change the id

Thanks

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@rbrownauthorMay 24.2010 — Here is my effort which currently doesnt work, hopefully this can be a start point.

[CODE]<body>
<?php
$tab=$_REQUEST['tab'];
if($tab=='') $tab='show';
?>
<ul id="tabs">

<?php if($tab=='show'){ ?>
<li><b><span>Now Showing</span></b></li>
<? }else{ ?>
<li><a href="?tab=show"><span onclick="variable = 0">Now Showing</span></a></li>
<? } ?>

<?php if($tab=='soon'){ ?>
<li><b><span>Coming Soon</span></b></li>
<? }else{ ?>
<li><a href="?tab=soon"><span onclick="variable = 1">Coming Soon</span></a></li>
<? } ?>

<?php if($tab=='family'){ ?>
<li><b><span>Family Films</span></b></li>
<? }else{ ?>
<li><a href="?tab=family"><span onclick="variable = 2">Family Films</span></a></li>
<? } ?>
</ul>



<div id="carousel">
<?php wp_carousel( echo '<script type="text/javascript">var variable = ', $variable, ';</script>'; ); ?>
</div>
</body>[/CODE]
Copy linkTweet thisAlerts:
@KorMay 25.2010 — When analyzing JavaScript codes, PHP (or ASP, or whichever other server-side language) is irrelevant. We need to see [I]the generated HTML code[/I] instead. And, please, detail your aim - it is not very clear what you need.
×

Success!

Help @rbrown 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.2,
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: @meenaratha,
tipped: article
amount: 1000 SATS,

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

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