473,385 Members | 1,912 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

class="classA classB" + this.className="classC" means you wiped classA too?

if you assign multiple classes in order to keep your classes generic
e.g
..classA { position.absolute; left:5 top:5 height:200 width:800 }
..classB { background-color: red}
..classC { background-color: green}

<div id="div1" class="classA classB" ...

but then want to dynamically assign a new class

onMouseOver="this.className='classC'" or onMouseover="changeclass(div1,classC)"

does classC replace BOTH the other classes?

If so can you go:

onMouseOver="this.className='classA classC'"

or what?

can't find any answers to this question via google. thanx

peter

p.s
seems to me that class assignment would be better as an array

eg p."id"[1]=class

also there isn' much scope for encapsulation or inheritance as
Jul 20 '05 #1
1 5644
Peter King wrote on 10 nov 2003 in
comp.infosystems.www.authoring.stylesheets:
<div id="div1" class="classA classB" ...

but then want to dynamically assign a new class

onMouseOver="this.className='classC'" or
onMouseover="changeclass(div1,classC)"

does classC replace BOTH the other classes?


try:

==================

<style>
.classA {color:green;width:250px;}
.classB {font-size:20pt;}
.classC {background-color:red;}
</style>

<div class="classA classB"
onMouseOver="this.oldClasses=this.className;this.c lassName+=' classC'"
onMouseOut="this.className=this.oldClasses">
TEST
</div>

<br>

<div class="classA classC"
onMouseOver="this.oldClasses=this.className;this.c lassName+=' classB'"
onMouseOut="this.className=this.oldClasses">
ME
</div>

==================

IE6 tested

--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: sloan | last post by:
How does one "pass thru" a Raised Event.... I am using the Adapter Pattern to sync up some different interfaces. http://www.dofactory.com/Patterns/PatternAdapter.aspx My Question is this:
30
by: Medvedev | last post by:
i see serveral source codes , and i found they almost only use "new" and "delete" keywords to make they object. Why should i do that , and as i know the object is going to be destroy by itself at...
2
by: manontheedge | last post by:
I'm trying to pass a pointer of a class into another class' constructor. I keep getting the error "missing default parameter", here's a hopefully simplified example of what I'm trying to do... ...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.