0

I have this working code for IMAGES:

<a class="showimage" rel="http://www.sitename/images/image.png" >
<span>hover here</span>
</a>

plus some javascript and css code.... so the final result is now when you hover on "hover here" it shows the actual IMAGE "http://www.sitename/images/image.png" - something like this ( http://goo.gl/jhyNm )

What I want to ask is, is it possible to show/play .SWF file instead of image.... so the process is the same, I hover on "hover here" text and it shows the .SWF ?

Any help will be appreciated. Thanks

Vzlotea
  • 97
  • 2
  • 12

2 Answers2

1

I'm not 100% sure, but you can try to embed SWF in div element and using JS detect mouse over event on "hover here" and then show or hide div.

  • Hi. Thanks I've got it working by embedding object and now when hovering it also PLAYS the swf not only shows it. Cheers – Vzlotea Aug 25 '12 at 16:14
1

About "showing" the .swf file - it's pretty easy, about "playing" it - I don't really know if it's possible just with js. I guess you'll need some API involved. (an autoplay option if exists).

Anyway,html:

<a href='#' id='showMovieText'>
Hover Me
<div style='display:none'>
<!--EMBEDED SWF FILE HERE-->
<embed ....>
</div>
</a>

jQuery:

$('#showMovieText').hover(function(){
 $(this).find("div").css('display','block');
});

Demo: http://jsfiddle.net/YbWgh/

Ofir Baruch
  • 10,323
  • 2
  • 26
  • 39