redho home | products | services

Programming Forums


Community for Java, PHP, Perl C, ASP and Python programmers
Wednesday 12 December 2018 21:42

Ask your IT question here

onclick event



 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JavaScript forum
View previous topic :: View next topic  
Author Message
Koplaf
Enthusiastic Coder


Joined: 28 May 2006
Posts: 130
Hello.
I have a list of news.
And till now the layout was solved with tables.
Each news was in a table row and had 3 extra events... onmouseover, onmouseout and onclick
I solved onmouse over and onmouse out with css and htc behaviours
For ie.
Now, how can I solve the onclick event?
I would like to optimize the code as much as possible.

Reply with quote
 
autos06
Enthusiastic Coder


Joined: 13 May 2006
Posts: 123
Location: New York
It sounds like your question is "I'm doing something (but I won't tell you what) with JavaScript onclick, and now I want to do it another way. How can I do that?". If that is the question, then we really don't have enough information to make any suggestions.
Reply with quote
 
Koplaf
Enthusiastic Coder


Joined: 28 May 2006
Posts: 130
So instead of puttin onmouseclick=somefunction() to each DIV I'd like to make a function that will append this functio automaticall7y to all DIVs in let say <DIV id="news">
autos06, do you get what I'd like? is not what you suggested

Reply with quote
 
autos06
Enthusiastic Coder


Joined: 13 May 2006
Posts: 123
Location: New York
Var divs = document.getElementById('news').getElementsByTagName('div'); for (var i = divs.length; i; i--) { divs[i].onclick = somefunction; } I guess.
Reply with quote
 
Koplaf
Enthusiastic Coder


Joined: 28 May 2006
Posts: 130
Nice
Somenthing like this, ye :D
But something like this I have to call onPageLoad, right?

Reply with quote
 
autos06
Enthusiastic Coder


Joined: 13 May 2006
Posts: 123
Location: New York
Onload, yes.
Reply with quote
 
Koplaf
Enthusiastic Coder


Joined: 28 May 2006
Posts: 130
Thanks alot for helping me out
Reply with quote
 
Page 1 of 1
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Programming Forums -> JavaScript forum


Dubai Forums - Expat Help | Vegan Forum | Java Programming | 3d Design Resources | 3d Forum | 3D Jobs | 3D Textures | Paris Forum | Europe Forum
Dubai Classifieds | Dubai Property | Jobs in Dubai | Free London Classifieds | Jobs in London UK

High Quality, Custom 3d animation and Web Design solutions Royal Quality Web Hosting Services Vegetarian and Animal Rights news

© 2018 RedHo