Connecting Tech Pros Worldwide Help | Site Map

Can a div be the used for onClick

 
LinkBack Thread Tools Search this Thread
  #1  
Old July 20th, 2005, 08:21 PM
bill
Guest
 
Posts: n/a
Default Can a div be the used for onClick

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


  #2  
Old July 20th, 2005, 08:21 PM
Andrew Tang
Guest
 
Posts: n/a
Default 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


  #3  
Old July 20th, 2005, 08:22 PM
bill
Guest
 
Posts: n/a
Default 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

 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Popular Articles

What is Bytes?

We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights. Get the best answers to your questions from over 220,662 network members.