473,479 Members | 2,087 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

can't set mouse cursor

hello,

I'm writing a panoramic image viewer in javascript. When the mouse is over
the image, I want it to be a crosshair (over most of the image), or a
hand/pointer (when it's over an image map region). The image map is
created in javascript, but doesn't set any 'cursor' style rules.

The problem I'm having is I have two images embedded inside two divs. The
outer div has style='... cursor:crosshair', but when I move over the image
(which covers the same area as the div), the pointer doesn't change. If I
look in the DOM inspector (in Firefox 1.5), the computed style for the
cursor property is 'pointer' on both images. I don't understand how this
could be happening, as I've never set this property for the images, and I
thought it should follow automatically the enclosing node. The html is
pasted below.

!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Middlewood Virtual Tour page</title>
<script type="text/javascript" src="js/dojo/dojo.js"></script>
<script type="text/javascript" src="js/pano.js"></script>
</head>
<body>
<h2 id="heading">Middlewood Virtual Tour demo page</h2>
<table border="0" cellpadding="0" cellspacing="10px" width="100%">
<column width="70%" /><column width="30%" />
<tbody>
<tr>
<td valign="top">
<div id="panoDiv" style="position: relative; top: 0px; left: 0px; overflow:hidden; cursor:crosshair">
<div id="panoInnerDiv" style="" >
<span id="panoMsg" style="visibility: visible"><b>Please wait while the image loads...</b><br /><br /> If it doesn't load, you may be using an incompatible browser - this page views best under mozilla firefox.</span>
<img src="" alt="" style="position: absolute; left: 0px; top: 0px; visibility: hidden; z-index:1; border:0px;" id="panoImage1" usemap="#panoMap">
<img src="" alt="" style="position: absolute; left: 0px; top: 0px; visibility: hidden; z-index:1; border:0px;" id="panoImage2" usemap="#panoMap"></div>
</div>
</td>
<td valign="top">
To scroll the panorama, click in the image and hold the mouse button down. Hover over the circle icons to find out more about the object. The arrow icons show paths you can take (not finished yet.)<br />
If the panorama doesn't scroll, try refreshing the page - there is an occasional bug which does this.<br /><br />
<span id="panoInfo">
</span>
<p id="message1">&nbsp;</p>
<p id="message2">&nbsp;</p>
</td>
</tr>
<tr>
<td colspan="2" valign="top">
<table border="0px" cellpadding="0px" cellspacing="10px">
<column width="20%" />
<column width="80%" />
<tbody>
<tr>
<td valign="top">
Viewport size:
<select name="resSelect" id="resSelect">
<option value="400">400 pixels high</option>
<option value="280" selected>280 pixels high</option>
<option value="200">200 pixels high</option>
<option value="140">140 pixels high</option>
<option value="100">100 pixels high</option>
</select>
</td>
<td valign="top">
<span id="panoControl"></span>
</td>
</tr>
</tbody>
<table>
</td>
</tr>
</tbody>
</table>
<input type="checkbox" name="showClicks" id="showClicks"> Record mouse clicks<br />
<span id="clickSpan"></span>
<p>&nbsp;</p>
</body>
</html>
--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 31 '06 #1
1 4582
Andy Baxter said:
hello,

I'm writing a panoramic image viewer in javascript. When the mouse is over
the image, I want it to be a crosshair (over most of the image), or a
hand/pointer (when it's over an image map region). The image map is
created in javascript, but doesn't set any 'cursor' style rules.

The problem I'm having is I have two images embedded inside two divs. The
outer div has style='... cursor:crosshair', but when I move over the image
(which covers the same area as the div), the pointer doesn't change. If I
look in the DOM inspector (in Firefox 1.5), the computed style for the
cursor property is 'pointer' on both images. I don't understand how this
could be happening, as I've never set this property for the images, and I
thought it should follow automatically the enclosing node. The html is
pasted below.
(I should add that at the moment, the cursor doesn't change at all - it
just stays as the default pointing arrow cursor)
!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html; charset=ISO-8859-1" http-equiv="content-type">
<title>Middlewood Virtual Tour page</title>
<script type="text/javascript" src="js/dojo/dojo.js"></script>
<script type="text/javascript" src="js/pano.js"></script>
</head>
<body>
<h2 id="heading">Middlewood Virtual Tour demo page</h2>
<table border="0" cellpadding="0" cellspacing="10px" width="100%">
<column width="70%" /><column width="30%" />
<tbody>
<tr>
<td valign="top">
<div id="panoDiv" style="position: relative; top: 0px; left: 0px; overflow:hidden; cursor:crosshair">
<div id="panoInnerDiv" style="" >
<span id="panoMsg" style="visibility: visible"><b>Please wait while the image loads...</b><br /><br /> If it doesn't load, you may be using an incompatible browser - this page views best under mozilla firefox.</span>
<img src="" alt="" style="position: absolute; left: 0px; top: 0px; visibility: hidden; z-index:1; border:0px;" id="panoImage1" usemap="#panoMap">
<img src="" alt="" style="position: absolute; left: 0px; top: 0px; visibility: hidden; z-index:1; border:0px;" id="panoImage2" usemap="#panoMap"></div>
</div>
</td>
<td valign="top">
To scroll the panorama, click in the image and hold the mouse button down. Hover over the circle icons to find out more about the object. The arrow icons show paths you can take (not finished yet.)<br />
If the panorama doesn't scroll, try refreshing the page - there is an occasional bug which does this.<br /><br />
<span id="panoInfo">
</span>
<p id="message1">&nbsp;</p>
<p id="message2">&nbsp;</p>
</td>
</tr>
<tr>
<td colspan="2" valign="top">
<table border="0px" cellpadding="0px" cellspacing="10px">
<column width="20%" />
<column width="80%" />
<tbody>
<tr>
<td valign="top">
Viewport size:
<select name="resSelect" id="resSelect">
<option value="400">400 pixels high</option>
<option value="280" selected>280 pixels high</option>
<option value="200">200 pixels high</option>
<option value="140">140 pixels high</option>
<option value="100">100 pixels high</option>
</select>
</td>
<td valign="top">
<span id="panoControl"></span>
</td>
</tr>
</tbody>
<table>
</td>
</tr>
</tbody>
</table>
<input type="checkbox" name="showClicks" id="showClicks"> Record mouse clicks<br />
<span id="clickSpan"></span>
<p>&nbsp;</p>
</body>
</html>


--
http://www.niftybits.ukfsn.org/

remove 'n-u-l-l' to email me. html mail or attachments will go in the spam
bin unless notified with [html] or [attachment] in the subject line.

May 31 '06 #2

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

Similar topics

3
17284
by: Csaba2000 | last post by:
I have set onmousedown to change the cursor, but this setting is ignored (IE 5.5; NN 6.1 on Win 2K Pro) until the mouse is either moved or the mouse button is released. On Opera 7.01, the setting...
7
2408
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...
2
3033
by: Gas | last post by:
Hi, I also want to know how to change the mouse cursor to normal, hourglass.....etc. in runtime thanks Gas
4
2224
by: Raj Chudasama | last post by:
I have a controls similiar to the windows calculator. (Please press some buttons on your calculator to see what i am talking about) So when u hover over a button it will change the state (it...
3
2860
by: Uma sakshi | last post by:
Hi I have one VB.NET application,in that application i have one datagrid control.The datagrid control contains somedata.I want to copy the data in a particular cell and paste it into my C#.NET...
2
7248
by: Fei | last post by:
Hi, Is this possible that when the user move out a form, the mouse is disabled/hidden? I want to restrict user to use mouse just in my application. Thanks ! Fei
3
3749
by: Morten Snedker | last post by:
If I have a number of random applications open, move the mouse cursor to a given position and do a click, the application gets the focus. That is what this simple code should illustrate: Dim...
6
3068
by: c.k. | last post by:
I was wondering if there was a way to give mouse movement on an empty form some lag/delay? For instance, user moves mouse, and the cursor is 20ms (possible adjustable from some option) behind the...
0
2288
by: Studlyami | last post by:
I am trying to find how windows translate the input from a HID device to an actual windows message; specifically, the mouse. I am trying to figure out how when the mouse moves the process windows...
0
7027
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
6899
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
7067
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...
1
6719
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
5312
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,...
1
4757
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...
0
4463
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
1
555
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
166
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...

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.