Flash or object tag inside an anchor link

前端 未结 2 1437
孤城傲影
孤城傲影 2021-01-21 06:58

Is it possible to insert a link to the object tag where after you click it you will be redirected to that link?

I already tried this:



        
相关标签:
2条回答
  • 2021-01-21 07:17

    I know this is a very old post, but at least now you can make the link clickable also like this:

    a {
      position: relative;
      z-index: 1;
    }
    
    object {
      position: relative;
      z-index: -1;
    }
    
    0 讨论(0)
  • 2021-01-21 07:18

    I'm assuming adding a button in the flash object is out of the question, in that case you can position the anchor over the flash object, using "position: absolute" and z-index (optional). Example: http://jsfiddle.net/qbK5Q/ (I haven't used an actual flash object, but it should work with one):

    <div class="objectContainer">
        <object>...</object>
        <a href="#">Test link</a>
    </div>
    

    CSS:

    a {
        display: block;
        position: absolute;
        width: 100%;
        height: 100%;
        z-index: 5;
        top: 0px;
        left: 0px;
        background-color: rgba(255,112,0,0.5);
    }
    .objectContainer {
        position: relative;
        width: 100px;
    }
    

    If it's a flash object, make sure that it has the "wmode" param set to "transparent" or "opaque". The problem with this solution is that the link will cover the flash object making it inaccessible to your mouse cursor (buttons and mouse events inside flash won't be accessible to the user).

    0 讨论(0)
提交回复
热议问题