LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-17-2005, 04:39 PM   #1
pld
Member
 
Registered: Jun 2003
Location: Southern US
Distribution: Ubuntu 5.10
Posts: 206

Rep: Reputation: 30
lookin for a javascript DOM guru...


Hi all,

Just a quick question. I have a table with many rows in it. I have currently implemented a simple rollover script to change the background color of the row when I rollover it:

... onmouseover='this.className="some classname" '

and a corresponding onmouseout call as well. basically just changing stylesheets on the fly

So, I have many many rows of data, and am running up into a problem with load times.

basically, i would love to just write a small jscript function to change the background color for me, cutting down on quite a bit of data.

however, i ma having problems effectively passing the current element to a jscript function correctly...

none of my rows have ID's assigned to them at the moment

Is there a simple way to pass a reference to a DOM object to a jscript function without using an id?

for instance, this doesnt work, but is more of what i am looking for:

onmouseover='myFunction(this)'

and then:

myFunction(var){
var.className="some_new_Class";
}

i hope i havent made a mess of trying to explain myself....
 
Old 02-17-2005, 05:14 PM   #2
marghorp
Senior Member
 
Registered: Jan 2004
Location: Slovenia
Distribution: Slackware 10.1, SLAX to the MAX :)
Posts: 1,040

Rep: Reputation: 45
You could do it with a loop, but I don't know how. I know it is possible to go through all the objects on the page using javascript loop (for or while...).

Try searching on that.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
Lookin for a special distro Xannax Linux - Newbie 10 10-29-2005 07:39 PM
javaScript - DOM, djgerbavore Programming 2 03-03-2005 04:44 AM
The best reason to use linux? - Your lookin at it Boffy General 3 04-16-2004 02:38 PM
XML php dom amirspl Programming 2 09-20-2003 06:04 AM
the howtos u might be lookin for... born4linux Linux - General 0 09-09-2003 08:30 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration