Not signed in (Sign In)

SkillShare - A place to discuss Web Standards and Web Design topics

Categories

Vanilla 1.1.9 is a product of Lussumo. More Information: Documentation, Community Support.

    • CommentAuthorThaLyric
    • CommentTimeAug 22nd 2006
     permalink
    Hello,

    I have an A-element and I have put sIFR on this A-element. So, everything goes well, I can click on the sIFR element. But now I want to add a eventhandler to the A-element (onClick), so when I click on the sIFR element the javascript event handler will be fired. But I can't get it to work. Can somebody help me?
    •  
      CommentAuthornifkin
    • CommentTimeAug 22nd 2006
     permalink
    You can't just apply your JS to the A element (since it's being removed from the page and replaced with the flash it doesn't exist any more, hence, no JS gets triggered), you'll need to find a way to add it to the getURL(); that gets triggered from within the sIFR flash.

    Doing something like <a href="javascript:alert('ZOMGWHAT!?!1!');">replaced by sIFR!</a> might work. (Though that gets into a usability/accessibility debate all it's own.)
    •  
      CommentAuthorJohnRiv
    • CommentTimeAug 22nd 2006
     permalink
    Check out this article: sIFR and anchors can be friends!

    It shows you how to create a "ghost node" (basically a clone of the A-element with the text hidden) on top of your sIFR Flash object. You can then apply the event handler to the clone.

    The article is from a year ago, so the code lines he refers to are most likely different in the latest version of sIFR, but he gives a pretty detailed walkthrough of how to make the changes so you should be able to make it happen with the most recent version.

    You'll also want to check out “More content” links, cloneNode(), YUI and Safari/MSIE issues to see the workaround for the issues involved with applying event handlers to cloned elements.
Add your comments
    Username Password
  • Format comments as (Help)