views:

5550

answers:

5

Actually I am trying to move some box alternatively with in another box. I made it work, but both the blocks do not interrupt each other. What should I do? How can I make the blocks cross each other? I try using style:position, but it is not working.

Here is the code I have been using:

<marquee direction="down" behavior="alternate" scrollAmount=10 style="border:2px solid blue;">
  <marquee behavior="alternate" scrollAmount=50 >
    <img src="img1.JPG">
  </marquee>
  <marquee behavior="alternate" scrollAmount=10 >
    <img src="img1.JPG">
  </marquee>
</marquee>

What am I doing wrong?

+44  A: 

Please don't use the marquee tag, it's non-standard and deprecated. Use some JavaScript library like jQuery UI for any kind of animation.

Baishampayan Ghose
anti-marquee-ite!
Jeff Atwood
Haha! I believe the only place where the marquee can exist now is the ``History of the WWW Museum''. It's so Web 0.01-ish...
Baishampayan Ghose
marquee is preferable to a scripted animation, because there are browsers where it doesn't work. Any case where this kind of effect fails has got to be a good thing.
bobince
@bobince That's some shoddy browsers you're using ;-)
Ross
marquee works fine, as long as it's combined with blink, font-site: xx-large and font-color: red.
Michael Stum
not only is it non standard, it is deprecated http://en.wikipedia.org/wiki/Marquee_tag (despite what jeff or joel said on the podcast about it being 'in all the browsers' you shouldnt use it)
Simon_Weaver
@Micheael Stum hahahah
alex
+2  A: 

Use a JavaScript library or if not use JavaScript's settimeout plus absolute positioning & dhmtl.

apphacker
Funny that this is essentially the same as the highest rated answer, yet it's negative. Silly voters. If you vote this one down, did you also vote down the first one?
Adam Davis
@Adam, seeing as it was already provided as an answer before he posted it, then the question doesn't need two of the same. Additionally, he could be trying to just get an up in reputation by copying the highest answer.
Evan Fosmark
I wasn't. I was just answering the question. I don't think it merits the -5, but whatever.
apphacker
+59  A: 

Oh, dear Lord!

Well. They don't cross because they're positioned statically one above the other. The second marquee cannot go above the first.

You can solve* this problem by ungluing the marquees from each other using absolute positioning. Then doubly-nest each one with different horizontal and vertical motion:

<div style="border:2px solid blue; position: relative;">
    <marquee direction="down" behavior="alternate" scrollAmount="10">
        <marquee behavior="alternate" scrollAmount="50"><img src="img1.jpeg" alt="oh no" /></marquee>
    </marquee>
    <marquee direction="down" behavior="alternate" scrollAmount="20" style="position: absolute; top: 0;">
        <marquee behavior="alternate" scrollAmount="10"><img src="img1.jpeg" alt="help meee" /></marquee>
    </marquee>
</div>

*: for values 'x' of 'solve' where x='make a hideous mess of'.

This is for illustration purposes only. Please don't use this.

bobince
In IE 7 for me the top marquee obscures the bottom one so you only see one image bouncing around the box. Not sure what other browsers will have trouble with it.
p5ycho_p3nguin
Encasing the second set of marquees in another div and giving it a higher z-index seems to solve this. For some reason though you can't just give the marquees a z-index.
p5ycho_p3nguin
Interesting, thanks for the catch - I only tested in 'fox3, as I couldn't stand to look at the results any longer than I had to :-)
bobince
I love that this was marked offensive.
Chris Marasti-Georg
Props for closing the image tags !!!
Reece
+2  A: 

I once had an email (a javascript-less environment) from a company trying to sell me something or other. The signature used the marquee tag to slide in the lines one at a time, and they then stayed put. It was brilliantly done - just enough movement to catch the eye, and certainly not cringeworthy as we usually expect from marquee.

The lessons I learned are a) that marquee still has its place, no matter how small, and b) 'All generalisations are bad'. As for non-standard/deprecated - Outlook has pretty much dictated that the only rule in HTML emails is that if it works, it's good. There no use in polishing a you-know-what.

Sounds irritating.
Wahnfrieden
I think, considering email, the web is not evolved enough yet. Using web-techniques from HTML1/2 in emails is common as the whole div layout thing is not working with a lot of clients. Table-full designs are still often used. In such a case it's not such a big shame to be using marquee. I've never liked it though, because it shows up differently in different browsers which kinda messes up the point of having a marquee in there in the first place
xaddict
by the way. this is the 'slide' behavior of the marquee tag. coming in from one side, moving to the other and then stop the motion.browser compatibility:IE:2.0 | NN:7.0 | MOZ:1.01 | FF:1.0 | OP:7.20
xaddict
A: 

Problems with the <marquee> tag... let's see:

  • Its existence
palswim