473,396 Members | 1,990 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,396 software developers and data experts.

Mouse over regions

Ok here's my problem: I have a large number of pages that each contain a
large image that when a user mouses over a specific region of the image I
need that section of it to show a new image (essentially highlighting the
area with a border and some bold text). I have it working fine using
imagebuttons, but my problem is that in order to create the image buttons, I
have to crop the large image file into smaller regions in Photoshop to make
image buttons and then calculate where on the page each image goes, etc.
etc. A lot of work that I would like to avoid.

My ideal solution, if such a thing exists, is to just be able to create hot
spot regions on parts of the main image and when a user moves over the hot
spot region it will trigger some code (ideally on the client side) and have
the main image change to show the highlighted region (essentially
eliminating the necessity of say an image button).

I played around some with imagemaps, but it doesn't seem to contain any
onmouseover properties.

Any experts out there know a slicker way to handle what I want to do?

Mark

Jul 26 '06 #1
3 7292
Image Maps are exactly what you want to do. Just add the onMouseOver
attribute and then your client-side code to the <AREAtags.
"Mark Denardo" <ma**@markdenardo.netwrote in message
news:JY******************************@starstream.n et...
Ok here's my problem: I have a large number of pages that each contain a
large image that when a user mouses over a specific region of the image I
need that section of it to show a new image (essentially highlighting the
area with a border and some bold text). I have it working fine using
imagebuttons, but my problem is that in order to create the image buttons,
I have to crop the large image file into smaller regions in Photoshop to
make image buttons and then calculate where on the page each image goes,
etc. etc. A lot of work that I would like to avoid.

My ideal solution, if such a thing exists, is to just be able to create
hot spot regions on parts of the main image and when a user moves over the
hot spot region it will trigger some code (ideally on the client side) and
have the main image change to show the highlighted region (essentially
eliminating the necessity of say an image button).

I played around some with imagemaps, but it doesn't seem to contain any
onmouseover properties.

Any experts out there know a slicker way to handle what I want to do?

Mark

Jul 26 '06 #2
I get an error when I try to add a property to RectangleHotSpot. Am I
spelling it correct (I cut and pasted the same code I used on the image
button and it worked fine there)

Parser Error Message: Type 'System.Web.UI.WebControls.RectangleHotSpot' does
not have a public property named 'onmouseover'.

Here's my markup code:
<asp:ImageMap ID="ImageMap1" runat="server" Style="left: 100px; position:
absolute; top: 200px"

ImageUrl="~/Images/maps/main.gif" onclick="ImageMap1_Clicked"
width="1073" height="635">

<asp:RectangleHotSpot

Left="0" Top="0" Bottom="334" Right="573"

hotspotmode="PostBack"

postbackvalue="NW"

onmouseover="this.src='../Images/maps/NW.gif'"

onmouseout="this.src='../Images/maps/main.gif'"

/>


</asp:ImageMap>
"Scott M." <s-***@nospam.nospamwrote in message
news:eR**************@TK2MSFTNGP02.phx.gbl...
Image Maps are exactly what you want to do. Just add the onMouseOver
attribute and then your client-side code to the <AREAtags.
"Mark Denardo" <ma**@markdenardo.netwrote in message
news:JY******************************@starstream.n et...
>Ok here's my problem: I have a large number of pages that each contain a
large image that when a user mouses over a specific region of the image I
need that section of it to show a new image (essentially highlighting the
area with a border and some bold text). I have it working fine using
imagebuttons, but my problem is that in order to create the image
buttons, I have to crop the large image file into smaller regions in
Photoshop to make image buttons and then calculate where on the page each
image goes, etc. etc. A lot of work that I would like to avoid.

My ideal solution, if such a thing exists, is to just be able to create
hot spot regions on parts of the main image and when a user moves over
the hot spot region it will trigger some code (ideally on the client
side) and have the main image change to show the highlighted region
(essentially eliminating the necessity of say an image button).

I played around some with imagemaps, but it doesn't seem to contain any
onmouseover properties.

Any experts out there know a slicker way to handle what I want to do?

Mark


Jul 26 '06 #3
Do it in your code behind:

ImageMap1.attributes.add("onclick", "ImageMap1_Clicked")

"Mark Denardo" <ma**@markdenardo.netwrote in message
news:Fa******************************@starstream.n et...
>I get an error when I try to add a property to RectangleHotSpot. Am I
spelling it correct (I cut and pasted the same code I used on the image
button and it worked fine there)

Parser Error Message: Type 'System.Web.UI.WebControls.RectangleHotSpot'
does not have a public property named 'onmouseover'.

Here's my markup code:
<asp:ImageMap ID="ImageMap1" runat="server" Style="left: 100px; position:
absolute; top: 200px"

ImageUrl="~/Images/maps/main.gif" onclick="ImageMap1_Clicked"
width="1073" height="635">

<asp:RectangleHotSpot

Left="0" Top="0" Bottom="334" Right="573"

hotspotmode="PostBack"

postbackvalue="NW"

onmouseover="this.src='../Images/maps/NW.gif'"

onmouseout="this.src='../Images/maps/main.gif'"

/>


</asp:ImageMap>
"Scott M." <s-***@nospam.nospamwrote in message
news:eR**************@TK2MSFTNGP02.phx.gbl...
>Image Maps are exactly what you want to do. Just add the onMouseOver
attribute and then your client-side code to the <AREAtags.
"Mark Denardo" <ma**@markdenardo.netwrote in message
news:JY******************************@starstream. net...
>>Ok here's my problem: I have a large number of pages that each contain
a large image that when a user mouses over a specific region of the
image I need that section of it to show a new image (essentially
highlighting the area with a border and some bold text). I have it
working fine using imagebuttons, but my problem is that in order to
create the image buttons, I have to crop the large image file into
smaller regions in Photoshop to make image buttons and then calculate
where on the page each image goes, etc. etc. A lot of work that I would
like to avoid.

My ideal solution, if such a thing exists, is to just be able to create
hot spot regions on parts of the main image and when a user moves over
the hot spot region it will trigger some code (ideally on the client
side) and have the main image change to show the highlighted region
(essentially eliminating the necessity of say an image button).

I played around some with imagemaps, but it doesn't seem to contain any
onmouseover properties.

Any experts out there know a slicker way to handle what I want to do?

Mark



Jul 26 '06 #4

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

Similar topics

0
by: Aileen xyz via .NET 247 | last post by:
hi I'm writing a program that lets users create boxes, move themaround and link them together. I'm new to visual C++ so i keephaving syntax errors. The only way i've come up with to implement...
6
by: C# Learner | last post by:
1) How often do you put regions into your code? a) very often b) occasionally c) infrequently d) never 2) If you didn't answer (d), what do you use regions for? a) hiding ugly code
4
by: Simon | last post by:
Just starting on C# and would like to know what suggestions there are for the order in which declarations, event handlers, properties, private code, nested classes, etc, etc appear in your files....
16
by: Niels Jensen | last post by:
I have been developing a little project which draw's a hexgrid on a panel within a form similar to this - it:s used as a client from a e-mail based strategy game: ____ ____ / \...
7
by: gaidar | last post by:
Hi, everybody, I'm just wondering if someone really need stuff like this: http://msdn2.microsoft.com/library/ms123401.aspx. If you answer yes than explain, please. Thanks! Gaidar
2
by: Mirano | last post by:
Hi everybody. What is a general way to code the application that has some regions and needs to do the hit testing. Say, for example, I have a bitmap that shows the United States, now I want to...
4
by: | last post by:
Hello C-Sharpers, Lets say i have a UserControl which draws a circle of radius r at co-ordinates x,y. How can i tell if the cursor is currently inside or outside of the circle? thank you, bk
6
by: Ikke | last post by:
Hi everybody, Can somebody tell me how to disable regions in Visual Studio 2005? I've already told VS not to collapse code to regions in the settings, but each time I open a new (existing)...
8
by: Spleenwort | last post by:
With regard to XML comments in c#. I think that #regions should be self-documenting relative to XML comments or that a <region> tag should be defined and auto-inserted when you type #region...
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:
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
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
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,...
0
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...
0
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...
0
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,...

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.