Hi
I want to find the color vaule of text which is of different color when user will move mouse on the text/charector.It should display its color value in RGB format.
like
Code: ( text )
<p>Hello Muksh Kumar. Welcome to thescripts.com!
7 1969 gits 5,390
Recognized Expert Moderator Expert
hi ...
let me give you an idea to start with:
[HTML]
<script type="text/javascript">
function show_color(even t) {
var color = null;
var node = typeof window.event != 'undefined' ?
event.srcElemen t : event.target;
if (typeof window.getCompu tedStyle != 'undefined') {
color = window.getCompu tedStyle(node, '').getProperty Value('color');
} else if (typeof node.currentSty le != 'undefined') {
color = node.currentSty le.color;
}
alert(color);
}
</script>
<body>
<div onclick="show_c olor(event);"> test </div>
</body>
[/HTML]
kind regards
hi ...
let me give you an idea to start with:
[HTML]
<script type="text/javascript">
function show_color(even t) {
var color = null;
var node = typeof window.event != 'undefined' ?
event.srcElemen t : event.target;
if (typeof window.getCompu tedStyle != 'undefined') {
color = window.getCompu tedStyle(node, '').getProperty Value('color');
} else if (typeof node.currentSty le != 'undefined') {
color = node.currentSty le.color;
}
alert(color);
}
</script>
<body>
<div onclick="show_c olor(event);"> test </div>
</body>
[/HTML]
kind regards
Thanks Buddy! you really did a good job. Thanks lot
one more thing from where I can learn more about this topics
gits 5,390
Recognized Expert Moderator Expert
no problem ;) ... post back to the forum anytime you have more questions ...
kind regards
Thanks dear
Now if instead of text I use some image then how can I get the value of color of that Image?
gits 5,390
Recognized Expert Moderator Expert
i'm sorry ... but i'm quite sure that you cannot do that with javascript since the image is just a included external source and javascript has capabilities to retrieve html, css, js or browser-properties but we have no image-manipulation capabilities ... except retrieveing/setting its dimensions or attributes of the node itself (html-tag) ... but not the src ...
kind regards
i'm sorry ... but i'm quite sure that you cannot do that with javascript since the image is just a included external source and javascript has capabilities to retrieve html, css, js or browser-properties but we have no image-manipulation capabilities ... except retrieveing/setting its dimensions or attributes of the node itself (html-tag) ... but not the src ...
kind regards
Hi
might be you are right but how one can view the RGB value of image when some tool is used in that case also we drag/click the object and corresponding value of the image comes. Might be I asked some foolish thing but there is way to do it.
gits 5,390
Recognized Expert Moderator Expert
i remember this thread ... might be you could start from there to more explorations ...
kind regards
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: lkrubner |
last post by:
I know I'm missing something obvious, but I looked hard at this page
and did not see the format of the return specified:
http://us3.php.net/manual/en/function.ord.php
>From the limited example I assume it is the decimal (not hex or binary)
value of the character being returned?
So long as the returned value is between 0 and 127, I can treat it as
ascii?
|
by: Craig Wagner |
last post by:
I have a situation where I have a series of character codes stored in the
database. In some cases they are the ASCII value of the character, in other
cases they are the > 127 character code value that you use in combination with
the ALT key to enter special characters into a document (e.g. ALT+0147 and
ALT+0148 get you 'smart quotes').
I'm trying to figure out how (or if it's possible) to obtain the Unicode
equivalent of the character...
|
by: Craig Wagner |
last post by:
I have a situation where I have a series of character codes stored in the
database. In some cases they are the ASCII value of the character, in other
cases they are the > 127 character code value that you use in combination with
the ALT key to enter special characters into a document (e.g. ALT+0147 and
ALT+0148 get you 'smart quotes').
I'm trying to figure out how (or if it's possible) to obtain the Unicode
equivalent of the character...
|
by: farah727rash |
last post by:
Hi all,
I am trying to find the numerical value of a string that stores a two
digit number. I have found the numerical value of a char as:
char character;
cin >character;
int number = character - 48; // Computing the numberical value of
character entered
cout << "The number you entered is: " << number << endl << endl;
|
by: Just D |
last post by:
All,
Any valuable idea about subj: "The '%' character, hexadecimal value 0x25" ?
I tried to google, but nothing interesting was found.
Is it IIS settings problem, user side problem or whatever? We receive it
regularly and I guess the problem is not in our source codes. Please help!
Just D.
| |
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...
|
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,...
|
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...
|
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...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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...
| |
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...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols.
I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |