SitePoint Sponsor

User Tag List

Results 1 to 5 of 5
  1. #1
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    rollover cursor change

    I have this to change my cursor....

    <style>
    body { cursor:url(blupoint.cur);}

    </style>
    <a href="#">hover link to change cursor</a><br>
    <p onmouseover="changecursor()">hover mouseover to change cursor

    The pointer changes to blue, I also have a blue hand.
    I can change both white cursors, hand and pointer, but what I want is the hand cursor to be the default white on links, but blue on rollovers.

    Is there a way of forcing the cursor to change for mouseovers?
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  2. #2
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Code:
    <style type="text/css">
    
    a img {
    cursor: url(blupoint.cur)
    }
    
    </style>
    ...should do the trick.

    Fwiw, image cursors are not well yet supported x-browser/x-platform.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  3. #3
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    thanks...

    So not all css is cross browser? I didn't realise.
    I was going to try to use more of it!!
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if

  4. #4
    SitePoint Wizard Bill Posters's Avatar
    Join Date
    Dec 2001
    Location
    UK
    Posts
    1,523
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Apart from one or two hiccups on certain browsers, 'common/substantial' css is generally well supported by modern browsers.
    Image cursors are comparitively more 'exotic' than the common css used for text and layouts.
    Such bells 'n' whistles css attributes (image cursors) are generally further down the list of priorities for most browser developers so will take a while longer to be universally supported.

    One good thing about css is that browsers that do not support a certain property or attribute will generally ignore it altogether without letting it break the page/layout. So there's no harm in including them.

    You are pretty safe to use css for the vast majority of a web-design's layout and styling now (discounting support for legacy browsers).
    It's only with bits like image cursors that you need to check who will be able to see them and who won't.
    New Plastic Arts: Visual Communication | DesignateOnline

    Mate went to NY and all he got me was this lousy signature

  5. #5
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)

    Thanks again Bill, but

    I already had this;-

    document.write(
    '<style>',
    'body { cursor:url('+find+'images/blupoint.cur);}',
    'a { cursor:url('+find+'images/bluhand.cur);}',
    '</style>')

    but as some of my links are created with javascript; they act more like rollovers with onclicks rather than links, therefore not changing the cursor.

    could I use something like this.....
    document.write(
    '<img src=animage.gif style="cursor:url('+find+'images/bluhand.cur)" onmouseover=function()>')

    or maybe attach it to a class???

    <style>
    .bluhand { cursor:url(images/bluhand.cur);}
    </style>
    <img src=animage.gif class="bluhand" onmouseover=function()>

    NOTE: just tested above, and it works, thanks Bill.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •