making <div> a hyperlink

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Dave

    making <div> a hyperlink

    I've been given a flash banner and told to make it a hyperlink.

    I tried this: <script type="text/javascript">
    Document.getEle mentById("flash content").oncli ck = function(){
    window.location ='http://www.website.com '; }
    </script>

    but received an error stating that "Document" was undefined.

    I also tried this:


    <div class="linkdiv"
    onclick="javasc ript:location=' http://www.website.com '"
    id="flashconten t"which makes the white space in the <diva hyperlink
    that works but not the flash banner.

  • Ed Jay

    #2
    Re: making &lt;div&gt; a hyperlink

    Dave scribed:
    >I've been given a flash banner and told to make it a hyperlink.
    >
    >I tried this: <script type="text/javascript">
    >Document.getEl ementById("flas hcontent").oncl ick = function(){
    >window.locatio n='http://www.website.com '; }
    ></script>
    >
    >but received an error stating that "Document" was undefined.
    >
    >I also tried this:
    >
    ><div class="linkdiv"
    >onclick="javas cript:location= 'http://www.website.com '"
    >id="flashconte nt"which makes the white space in the <diva hyperlink
    >that works but not the flash banner.
    Is 'document' capitalized in js? I don't think so.

    Also, I ran into a similar issue with Firefox and I had to use
    window.document .... to resolve it.
    --
    Ed Jay (remove 'M' to respond by email)

    Comment

    • Dave

      #3
      Re: making &lt;div&gt; a hyperlink

      Thanks, Ed. I changed 'D' to 'd' in document but the result is the
      same. White space is hyperlinked. Flash banner is not. Added 'window'
      before 'document' without any effect.


      Ed Jay wrote:
      Dave scribed:
      >
      I've been given a flash banner and told to make it a hyperlink.

      I tried this: <script type="text/javascript">
      Document.getEle mentById("flash content").oncli ck = function(){
      window.location ='http://www.website.com '; }
      </script>

      but received an error stating that "Document" was undefined.

      I also tried this:

      <div class="linkdiv"
      onclick="javasc ript:location=' http://www.website.com '"
      id="flashconten t"which makes the white space in the <diva hyperlink
      that works but not the flash banner.
      >
      Is 'document' capitalized in js? I don't think so.
      >
      Also, I ran into a similar issue with Firefox and I had to use
      window.document .... to resolve it.
      --
      Ed Jay (remove 'M' to respond by email)

      Comment

      • VK

        #4
        Re: making &lt;div&gt; a hyperlink


        Dave wrote:
        I've been given a flash banner and told to make it a hyperlink.
        I can be wrong (I'd like to be) but you may have to return the job back
        - unless you can edit the Flash itself.

        Flash movie is an event consumer by its own. It means that as soon as
        mouse goes over it, it "disappears " for the document - all events are
        trapped by Flash. So you can twist around to catch say mouseover, but
        no way to know onclick.

        AFAIK

        Comment

        • Dave

          #5
          Re: making &lt;div&gt; a hyperlink

          I was afraid that might be the case. I told them to send me a .gif but
          was also wondering if I can put a clear button over it (something else
          I don't know how to do)?

          VK wrote:
          Dave wrote:
          I've been given a flash banner and told to make it a hyperlink.
          >
          I can be wrong (I'd like to be) but you may have to return the job back
          - unless you can edit the Flash itself.
          >
          Flash movie is an event consumer by its own. It means that as soon as
          mouse goes over it, it "disappears " for the document - all events are
          trapped by Flash. So you can twist around to catch say mouseover, but
          no way to know onclick.
          >
          AFAIK

          Comment

          • Joe D Williams

            #6
            Re: making &lt;div&gt; a hyperlink


            "Dave" <davepollak@gma il.comwrote in message
            news:1158888847 .156148.237860@ b28g2000cwb.goo glegroups.com.. .
            >I was afraid that might be the case. I told them to send me a .gif but
            was also wondering if I can put a clear button over it (something else
            I don't know how to do)?
            >
            VK wrote:
            >Dave wrote:
            I've been given a flash banner and told to make it a hyperlink.
            >>
            >I can be wrong (I'd like to be) but you may have to return the job back
            >- unless you can edit the Flash itself.
            >>
            >Flash movie is an event consumer by its own. It means that as soon as
            >mouse goes over it, it "disappears " for the document - all events are
            >trapped by Flash. So you can twist around to catch say mouseover, but
            >no way to know onclick.

            Maybe you can get an event from the active object into DOM.
            Then you can do anything you wish..
            For instance, another event consumer sort of like flash type
            is X3D. In the tutorial at:



            as a first step, it shows how they use DOM events
            and interfaces built into the embedded object to generate
            DOM events when certain events in the embedded object
            are initiated.

            All you need is a way for the active object to learn that the
            host DOM wants to listen for certain 'internal' events and a
            way to tell the host DOM 'external' script what to do when the
            event happens.

            So, if the object can know that it has a mouseover, which is
            a sort of focus, and you can setup a listener and callback,
            you may not have to change the object user code to get the
            result.

            But there must be some combination of html anchors, objects,
            and divs that would give an unambigious result of a mouse action
            in the space occupied by the active object.

            Best VRegards,
            Joe


            >>
            >AFAIK
            >

            Comment

            Working...