Forum Moderators: not2easy

Message Too Old, No Replies

changing class with checkbox

or any way that works

         

Powdork

3:23 am on Oct 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



here is the problem
i am setting up a weather page using a number of animated gifs. i want to have them all in one .swf so i can switch back and forth easily and add a bunch of interactivity. problem is that flash will only display the top image of an animated gif, so no looping that way.
so now i have it set up so that the animated gif is the background image for a table cell and the swf is the content of the cell and puts the various overlays on top of the animated gif.
however, i want the user to be able to click something to switch from the radar image to satellite or water vapor loop. also, the ideal solution would change the class of the element so i can adjust the position of the background image (the different gifs have different sizes and i need to focus on my locale).

any ideas?

jtlapp

5:46 am on Oct 15, 2009 (gmt 0)

10+ Year Member



Seems like you should be able to do this with Javascript and DOM. Handle onclick on some button, having it call a Javascript function that changes the contents of your variable-content table cell. You can use Javascript to change pretty much anything on the page at any time.

Powdork

6:12 am on Oct 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



if i am changing the class would it then require me to reload the page in order to switch the image and positioning, or would it just happen?

ps. i suck at js. i suppose i could also switch the actual .css file when they click on the button too, since that is something i'm more familiar with anyway. unless that's a bad idea.

swa66

10:46 am on Oct 15, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



A "click" is a load or a reload of a page unless you use javascript or flash to interact with.

Since you require flash to show the loop, why not make it all in flash: it'll be easier to get it all under control and interacting with the user. Adn it doesn;t even have to load all at the beginning.

Alternatively I do think it can be done with javascript.

CSS alone: I don't think there's any chance of a solution, esp. not if you rule out loading/reloading pages.

Powdork

3:11 am on Oct 17, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



can't do it with flash because it won't display anything but the top image of an animated gif.
i am thinking rather than use the background image as the animated gif i can put the gif in the table cell and then use css to place the swf over the table cell. i could then switch the image easily using function doButtons(picimage). problem is if any browser/screen combo places the swf differently, the results would be unacceptable.