/    Sign up×
Community /Pin to ProfileBookmark

Double function on the A tag

I am creating video gallery with one main player.

When user clicks on the link the youtube video will play but also if the video is below the fold I want the page to scroll up so the user can see the video.
Div ytvideo2 is the player window.

Is something like this even possible?

Here is my code:

[code=html]
<div class=”yt_holder”>
<div id=”ytvideo2″>This is my player window</div>
<ul class=”demo2″>
<li><a href=”http://www.youtube.com/watch?v=QBBWKvY-VDc”>Video 1</a></li>
<li><a href=”http://www.youtube.com/watch?v=ZXMQqLnRhRI”>Video 2</a></li>
<li><a href=”http://www.youtube.com/watch?v=Wvo-g_JvURI”>Video 3</a></li>
</ul>

<h1>WINNER</h1>
<ul class=”demo2″ id=”winner”>
<li><a href=”http://www.youtube.com/watch?v=ZXMQqLnRhRI” >Video 2</a></li>
</ul>
</div>
[/code]

Please help.

p.s
I will be using this on facebook tab.

to post a comment
JavaScript

0Be the first to comment 😎

×

Success!

Help @beatta 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 4.29,
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: @Yussuf4331,
tipped: article
amount: 1000 SATS,

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

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