/    Sign up×
Community /Pin to ProfileBookmark

I’m an absolute beginner, so please bear with me ?

The problem, basically, is as follows:

There’s some text-field on a webpage, containing information that needs to displayed with a CSS Marquee effect. E.g. :

Text-field 1 : Radiohead
Text-field 2 : King of Limbs

CSS Marquee : Band : Radiohead, Album: King of Limbs displayed.

Any tips on how to achieve that? Where do I start?
(Hope my explanation was clear enough) ?

to post a comment
JavaScript

12 Comments(s)

Copy linkTweet thisAlerts:
@pwinfreyApr 22.2011 — [CODE]<marquee>Band : Radiohead, Album: King of Limbs</marquee>[/CODE]

Is this what you're referring to?
Copy linkTweet thisAlerts:
@GerwantauthorApr 22.2011 — [CODE]<marquee>Band : Radiohead, Album: King of Limbs</marquee>[/CODE]

Is this what you're referring to?[/QUOTE]


Indeed.
Copy linkTweet thisAlerts:
@GerwantauthorApr 22.2011 — Just trying to find a way to "acquire" that information from those text-fields with a javascript so that it'd be displayed in the marquee automatically. Hope that's clear enough.
Copy linkTweet thisAlerts:
@pwinfreyApr 22.2011 — How are you storing the data in JavaScript?
Copy linkTweet thisAlerts:
@GerwantauthorApr 22.2011 — How are you storing the data in JavaScript?[/QUOTE]

I'm not. It's just a list done with CSS. Sorry if I'm sounding very beginner-ish ?
Copy linkTweet thisAlerts:
@pwinfreyApr 22.2011 — I'm having a disconnect as to why you need to use JavaScript if you're outputting the list already.
Copy linkTweet thisAlerts:
@GerwantauthorApr 22.2011 — I'm having a disconnect as to why you need to use JavaScript if you're outputting the list already.[/QUOTE]

I think my explanation just wasn't clear enough, so I'll try again. ?

The list is modified by users, but I want the marquee to "acquire" the relevant information (e.g. band name and album name) from the list field automatically (even after someone changed the relevant field) and display it.

Hope that has clarified it.
Copy linkTweet thisAlerts:
@pwinfreyApr 22.2011 — [CODE]<input type="text" id="band" value="Radiohead" onBlur="updateMarquee(this.id, this.value);" />
<input type="text" id="album" value="Kings of Limbs" onBlur="updateMarquee(this.id, this.value);" />

<marquee id="currentBandAndAlbum">Band: Radiohead, Album: Kings of Limbs</marquee>

<script>
function updateMarquee(id, value) {

if (id === 'band') {

document.getElementById('currentBandAndAlbum').innerHTML = 'Band: ' + value + ' Album: ' + document.getElementById('album').value;
}
else if (id === 'album') {

document.getElementById('currentBandAndAlbum').innerHTML = 'Band: ' + document.getElementById('band').value+ ' Album: ' + value;
}
}
</script>[/CODE]


Is this what you're after?
Copy linkTweet thisAlerts:
@GerwantauthorApr 22.2011 — Is this what you're after?[/QUOTE]

This will work even if the value "Radiohead" will be changed to something else, right? If so, that's exactly what I need. Many thanks! ?
Copy linkTweet thisAlerts:
@pwinfreyApr 22.2011 — Yeah, if you change either of the values it will update the marquee.
Copy linkTweet thisAlerts:
@GerwantauthorApr 22.2011 — Yeah, if you change either of the values it will update the marquee.[/QUOTE]

Great, that's it. Thanks again!
Copy linkTweet thisAlerts:
@pwinfreyApr 22.2011 — You're welcome.
×

Success!

Help @Gerwant 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.18,
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,
)...