By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,598 Members | 1,897 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,598 IT Pros & Developers. It's quick & easy.

making <div> a hyperlink

P: n/a
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 <diva hyperlink
that works but not the flash banner.

Sep 21 '06 #1
Share this Question
Share on Google+
5 Replies


P: n/a
Dave scribed:
>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 <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)
Sep 21 '06 #2

P: n/a
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.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 <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)
Sep 21 '06 #3

P: n/a
VK

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

Sep 21 '06 #4

P: n/a
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
Sep 22 '06 #5

P: n/a

"Dave" <da********@gmail.comwrote in message
news:11**********************@b28g2000cwb.googlegr oups.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:

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

Sep 22 '06 #6

This discussion thread is closed

Replies have been disabled for this discussion.