spirelli — 2012-02-29T09:06:40-05:00 — #1
I'm using this set-up: http://flowplayer.org/tools/demos/tabs/slideshow.htm
Works ok (with a bit more CSS to do):
However, what I now need is for the background color to change with each tab change. There is a bit of explanation on jQuery events here: http://flowplayer.org/tools/documentation/scripting.html#events But to be honest it doesn't mean much to me.
I've added data-bgcolor="#FF0000" to each of the image layers, and then tried adding this script
var bg = $(event.element).data('bgcolor');
Doesn't work: http://stage.truedesign.electra-2.titaninternet.co.uk/true/logos1.php
I would be grateful for any help, because I'm not fluent with JS at all, although I'm quite ok with HTML/CSS
paul_wilkins — 2012-02-29T15:16:15-05:00 — #2
The standard way of doing that is to remove a class name of "selected" from all the tabs, and then to add "selected" to the one that is currently selected.
That way you can use CSS to style the selected tab in the manner that it shoudl be styled, which helps to keep the presentational aspect of things right where it belongs.
spirelli — 2012-02-29T17:32:46-05:00 — #3
Thanks for the reply. Sorry if that wasn't clear, but
I'm not looking to change the style of each tab,
but the background color of the whole page, i.e. BODY tag.
paul_wilkins — 2012-03-01T02:01:29-05:00 — #4
I don't think that an event object has a property called element.
Try using event.target instead.