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

style.cursor in IE5

Further to my hassles with IE5, I think I've narrowed (one of) the
problems down to lines that try to set a cursor property. For example:

obj[1].style.cursor = "pointer";

This code works in IE 5.5+, MZ and FF. Is there something I can do to
get it to work in IE5?

Andrew Poulos
Jul 23 '05 #1
3 1875
Andrew Poulos wrote:
Further to my hassles with IE5, I think I've narrowed (one of) the
problems down to lines that try to set a cursor property. For example:

obj[1].style.cursor = "pointer";

This code works in IE 5.5+, MZ and FF. Is there something I can do to
get it to work in IE5?

Andrew Poulos


Dang, I just realised that "pointer" may be an invalid value for IE5
cursors. If it is, what's a cross browser solution?

Andrew Poulos
Jul 23 '05 #2
On Thu, 09 Dec 2004 10:07:48 +1100, Andrew Poulos <ap*****@hotmail.com>
wrote:

[snip]
Dang, I just realised that "pointer" may be an invalid value for IE5
cursors. If it is, what's a cross browser solution?


To use the proper value, however if you need this to work, you might try:

<script type="text/javascript">
var cursor = 'pointer';

function myFunction() {
/* ... */
object.style.cursor = cursor;
/* ... */
}
</script>

<!--[if lt IE 6]>
<script type="text/javascript">
/* Redefine the property value for
* IE versions earlier than 6
*/
cursor = 'hand';
</script>
<![endif]-->

As long as the second code block executes before the function, IE 5.5 and
earlier will use 'hand' rather than 'pointer'.

Hope that helps,
Mike

--
Michael Winter
Replace ".invalid" with ".uk" to reply by e-mail.
Jul 23 '05 #3
Michael Winter wrote:
On Thu, 09 Dec 2004 10:07:48 +1100, Andrew Poulos <ap*****@hotmail.com>
wrote:

[snip]
Dang, I just realised that "pointer" may be an invalid value for IE5
cursors. If it is, what's a cross browser solution?

To use the proper value, however if you need this to work, you might try:

<script type="text/javascript">
var cursor = 'pointer';

function myFunction() {
/* ... */
object.style.cursor = cursor;
/* ... */
}
</script>

<!--[if lt IE 6]>
<script type="text/javascript">
/* Redefine the property value for
* IE versions earlier than 6
*/
cursor = 'hand';
</script>
<![endif]-->

As long as the second code block executes before the function, IE 5.5
and earlier will use 'hand' rather than 'pointer'.


Thanks it looks like exactly what I need. I was going to do some browser
sniffing but now I don't need to.

Andrew Poulos
Jul 23 '05 #4

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

Similar topics

2
by: Csaba2000 | last post by:
The following code has me so confused, I don't even know the right questions to ask. Opera 7.01 and IE 5.5 both exhibit behaviours I don't understand while NN 6.1 seems to ignore me altogether. ...
3
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...
1
by: Yaron Cohen | last post by:
Hi, I would like to ask for your help (I am using only IE5.5). I have a very big table that I would like to sort. During the sort I would like the cursor changed to 'wait' state and back to...
18
by: Randall Sell | last post by:
http://www.bytewise.com.au/test/iebug.html I can not see why this doesn't work under IE6. Perhaps someone can shed some light on this, and a possible hack to get it to work. My ultimate goal is...
21
by: Michael Bierman | last post by:
Please forgive the simplicy of this question. I have the following code which attempts to determine the color of some text and set other text to match that color. It works fine in Firefox, but does...
19
by: CES | last post by:
All, I don't know why I always get stuck on the stupid questions... This is pretty straight forward... I want to change the cursor to the hand on a mouse event. This works just fine, if I use...
1
by: nikki.farrah | last post by:
Hi all, this is my first time posting so any help is appreciated! I am doing a simple AJAX request to our server, and I would like the cursor style changed to 'wait' when the user clicks a button...
1
by: ryezack | last post by:
i have an image map with an onmouseover event thats calls a javascript function style cursor is hand. this works in IE but not in firefox. here's the code: <script type="text/javascript"> <!--...
1
by: whitelined | last post by:
Does Opera have problems setting cursor style? I have the following code that works in FF & IE: this.pane.style.cursor = 'ne-resize'; It kind of works in opera, but seems to be variable to say...
4
by: datvong | last post by:
IE does not change the cursor immediately after a style.cursor is set. In the following sample, I have 2 divs, one inside another. The inner has a cursor of crosshair, outer a hand. If I click...
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
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?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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
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
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...
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...

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.