473,799 Members | 2,761 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Brighter / color inversion on mouse over

Hi guys,

I have a hard problem :) I have the following situation:

<span onmouseover = "SelectionEffec t()">
<div style="width: 50px; height: 50px;
background-color:#FFE4E1"> </div>
</span>
How can I code SelectionEffect () to have that when the mouse hover the
span the background color of the div becomes brigher, whatever color it
is?

Or perhaps even a color inversion (not R, not B, not G) within the span
would do (I want one "feels" he is moving over some area).

-Pam

Aug 24 '06
14 2994
pamelaflue...@l ibero.it wrote:
>... . The general rule for translating CSS
property names into - style - object property names is that the
character following the dash is make uppercase and the dash is
removed, so:-

border-style

- becomes:-

borderStyle
<snip>
Made the correction but still there must be some other problem.
Does not work. :(
<snip>
MyDiv.style.Bor derStyle = "double";
<snip>

You have uppercased the initial letter; it is only the letters
following a dash that need to be uppercase.

MyDiv.style.bor derStyle = "double";

Richard.

Aug 24 '06 #11
Yes Richard, sorry about that. My first attempt was pasting Your code.
Then I tried Uppercase (just in case!). Still no luck (?) :(

here it is the fellow:

<script type="text/javascript">

var PreviousStyle;

function mOver(MyDiv)
{
PreviousStyle = MyDiv.style.bor der-style;
MyDiv.style.bor derStyle = "double";
}
function mOut(MyDiv)
{
MyDiv.style.bor derStyle = PreviousStyle;
}

</script>
<div id="Square1" onclick="Cliked (This)" >
<div style="width: 50px; height: 50px; background-color:green"
onmouseover = "mOver(this )" onmouseout = "mOut(this) " ></div>
</div>

<br />

<div id="Square2">
<div style="width: 50px; height: 50px; background-color:red"
onmouseover = "mOver(this )" onmouseout = "mOut(this) " ></div>
</div>
Richard Cornford ha scritto:
pamelaflue...@l ibero.it wrote:
... . The general rule for translating CSS
property names into - style - object property names is that the
character following the dash is make uppercase and the dash is
removed, so:-
>
border-style
>
- becomes:-
>
borderStyle
<snip>
Made the correction but still there must be some other problem.
Does not work. :(
<snip>
MyDiv.style.Bor derStyle = "double";
<snip>

You have uppercased the initial letter; it is only the letters
following a dash that need to be uppercase.

MyDiv.style.bor derStyle = "double";

Richard.
Aug 24 '06 #12
Ah OK I got I. It works now! Beautiful

Thanks, Richard. You are my hero!

-pam

Richard Cornford ha scritto:
pamelaflue...@l ibero.it wrote:
... . The general rule for translating CSS
property names into - style - object property names is that the
character following the dash is make uppercase and the dash is
removed, so:-
>
border-style
>
- becomes:-
>
borderStyle
<snip>
Made the correction but still there must be some other problem.
Does not work. :(
<snip>
MyDiv.style.Bor derStyle = "double";
<snip>

You have uppercased the initial letter; it is only the letters
following a dash that need to be uppercase.

MyDiv.style.bor derStyle = "double";

Richard.
Aug 24 '06 #13
So... really this stuff is also case-sensitive: can't believe it !
This is really unfriendly!

-pam

pamelaflue...@l ibero.it ha scritto:
Ah OK I got I. It works now! Beautiful

Thanks, Richard. You are my hero!

-pam

Richard Cornford ha scritto:
pamelaflue...@l ibero.it wrote:
>... . The general rule for translating CSS
>property names into - style - object property names is that the
>character following the dash is make uppercase and the dash is
>removed, so:-

border-style

- becomes:-

borderStyle
<snip>
Made the correction but still there must be some other problem.
Does not work. :(
<snip>
MyDiv.style.Bor derStyle = "double";
<snip>

You have uppercased the initial letter; it is only the letters
following a dash that need to be uppercase.

MyDiv.style.bor derStyle = "double";

Richard.
Aug 24 '06 #14
pamelaflue...@l ibero.it wrote:
So... really this stuff is also case-sensitive
Everything in javascript is case-sensitive.
>: can't believe it !
This is really unfriendly!
<snip>

If a dynamic language like javascript attempted to be case-insensitive
(at least as far as property names are concerned) that would impose a
considerable run-time overhead.

Richard.

Aug 24 '06 #15

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

Similar topics

6
15905
by: Carla | last post by:
hi people, I have a little problem that I can't solve with css and i was wondering if you could help me. I have 4 links, I want that when I click/mouseover in the link 1, it turns to a color a, then when I click/mouseover over the link 2, it turns to a color b and the link 1 turns to the normal link color again. (an so with the other links). Is this possible with CSS?
12
2465
by: Thomas Matthews | last post by:
Hi, According to Robert Martin's Dependency Inversion Principle, http://www.objectmentor.com/resources/articles/dip.pdf, when there is a need to test the type of an object, the code inside the "switch cases" should be placed into the parent class. However, I am finding that this conflicts with the other principles -- the objects now must know details about
15
2346
by: | last post by:
Just about finished with an include modual that allows a user to select a color. Completely dynamic. all you have to do is include the script and run the main trigger script. One problem with the event modual is the fact that it resets events for all TD's. not sure how to specify to cascade down through just the created table. Any ideas? Feel free to use this where ever you wish as long as you give me credit. this was a few weeks of...
7
2446
by: fernandoronci | last post by:
Hi, I've been given the task of mantaining and fixing a website which I didn't design. I'm using Internet Explorer 5.5 and 6.x. Specifically, the problem is that navigation menues (written in javascript) don't disappear when the mouse moves outside of the area of the menues (some of the menues are nested two and three levels). As long as the mouse cursor remains *within* the options of the menues, the option under the mouse cursor is...
5
12698
by: Martha | last post by:
When I move my mouse over a hyperlink component, the hyperlink does not change color. How do I change the color of a hyperlink when the mouse goes over the hyperlink? or Change the color of a button component when the mouse goes over the button? I am using Microsfot Visual c#.net Version 7.1.3008
4
10853
by: Pucca | last post by:
How can I tell a mouse right clicks over a listview item that's in a container panel. I only want to display a popup menu if the user right click the mouse over an item on the Listview. I don't not want to display this menu if a node selected on the listview but user right click over the empty space of the panel that contain the listview. The problem here is when I use the Listview's Click Event, I don't have ways to verify if the...
19
5945
by: wmanzo | last post by:
I have a really professional conspiracy movie site and I use tons of layers and an external scroll bar assembly. I would like to put the various sections into MS Iframes and in order to clean up the page but I find that the iframes interfere with the getting the mouse coords from the screen which is essential in moving the scroll bar around. My test html is given below. With the iframe hidden the mouse coords are obtainable. With the...
3
427
by: lancered | last post by:
Hi dear all, I am using Python2.4.2+NumPy1.0.1 to deal with a parameter estimation problem with the least square methods. During the calculations, I use NumPy package to deal with matrix operations, mostly matrix inversion and trasposition. The dimentions of the matrices used are about 29x19,19x19 and 29x29. During the calculation, I noticed an apparent error of inverion of a 19x19 matrix. Denote this matrix as KK, U=KK^ -1, I found...
6
9726
by: marss | last post by:
Hi, How can I define in Firefox whether the left mouse button is pressed when I move mouse over a html element? The documentation says that "e.button == 0 for standard 'click', usually left button" http://developer.mozilla.org/en/docs/DOM:event.button Tracing of mouse clicks or mousedown/mouseup events looks not reliable, because mouse can be pressed elsewhere out of the html element (even outside of the browser) and then move over the...
0
9687
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9541
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10485
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10252
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10027
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9073
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7565
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5585
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
2938
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.