Connecting Tech Pros Worldwide Help | Site Map

Can a div be the used for onClick

bill
Guest
 
Posts: n/a
#1: Jul 20 '05
I inherited a site written with <layer> tags for 4.79. I want to update
it for Mozilla but am having .js problems. Changing the layers to divs
will be easy but one problem is that the site is written so that
clicking on a layer fires off some javascript that changes the
appearance of other layers. I can do the appearance/disappearance part,
but I can not figure out how to make a div such that clicking anywhere
on it will trigger javascript.

Suggestions and comments welcome.

The site is on an intranet and is not accessible from the world.
--
bill
Technical Service Systems
bill (atsign) TechServSys (period) com

unix is user friendly, it is just careful who it befriends

Andrew Tang
Guest
 
Posts: n/a
#2: Jul 20 '05

re: Can a div be the used for onClick



"bill" <nobody@spamcop.net> wrote in message
news:vn5i7d5jmh6if5@corp.supernews.com...
I can not figure out how to make a div such that clicking anywhere[color=blue]
> on it will trigger javascript.
>[/color]

What browser are you using? The code below worked in all the popular
browsers out there...

<div onclick="alert( 'yeah' );"
style="left:50px;top:50px;position:absolute;backgr ound-color:#12d635;width:1
50px;height;450px;">
This is a div
</div>

Is this what you wanted?

Andy


bill
Guest
 
Posts: n/a
#3: Jul 20 '05

re: Can a div be the used for onClick


Andrew Tang wrote:[color=blue]
> "bill" <nobody@spamcop.net> wrote in message
> news:vn5i7d5jmh6if5@corp.supernews.com...
> I can not figure out how to make a div such that clicking anywhere
>[color=green]
>>on it will trigger javascript.
>>[/color]
>
>
> What browser are you using? The code below worked in all the popular
> browsers out there...
>
> <div onclick="alert( 'yeah' );"
> style="left:50px;top:50px;position:absolute;backgr ound-color:#12d635;width:1
> 50px;height;450px;">
> This is a div
> </div>
>
> Is this what you wanted?][/color]

exactly what I wanted, I am using Mozilla 1.5b.

THIS TIME, it works like a charm. I must have had an error in my code
earlier. Thanks a lot !
[color=blue]
>
> Andy
>
>[/color]

--
bill
Technical Service Systems
bill (atsign) TechServSys (period) com

unix is user friendly, it is just careful who it befriends

Closed Thread