Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

making <div> a hyperlink

0 views
Skip to first unread message

Dave

unread,
Sep 21, 2006, 1:35:12 PM9/21/06
to
I've been given a flash banner and told to make it a hyperlink.

I tried this: <script type="text/javascript">
Document.getElementById("flashcontent").onclick = 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="javascript:location='http://www.website.com'"
id="flashcontent"> which makes the white space in the <div> a hyperlink
that works but not the flash banner.

Ed Jay

unread,
Sep 21, 2006, 2:18:28 PM9/21/06
to
Dave scribed:

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)

Dave

unread,
Sep 21, 2006, 3:15:27 PM9/21/06
to
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.

VK

unread,
Sep 21, 2006, 4:21:13 PM9/21/06
to

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

Dave

unread,
Sep 21, 2006, 9:34:07 PM9/21/06
to
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)?

Joe D Williams

unread,
Sep 21, 2006, 11:07:16 PM9/21/06
to

"Dave" <davep...@gmail.com> wrote in message
news:1158888847.1...@b28g2000cwb.googlegroups.com...


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:

http://www.ajax3d.org/content.html

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
>


0 new messages