• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

On mouse over / On click events

 
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi All,

I am trying to code a html page which is compatible across browsers.

have a look at the code


Pardon me for the coding standards..
Basically my header of the table will contain a link. I planned to make the whole header "clickable".
so on mouse over I change my cursor to hand and then keep an onclick event so that I can navigate to the url.


Now I tested this in

Fire Fox(2,3) : work's fine.
IE (6,7,8): Refuses to behave in the desired fashion.

I did read about this problem, but I was unable to figure out.

I also tried onmouseover instead of onMouseOver, onclick instead of onClick.

Kindly advise on the event handling.
 
author
Posts: 15385
6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You should not use setAttribute for setting events, an event handler is not an attribute.

Here is how you should add an event if you are not using a library such as jQuery
http://www.scottandrew.com/weblog/articles/cbs-events


BUT there is a better solution, no JavaScript is needed



Pure old CSS


Eric
 
sumanth kadaba
Greenhorn
Posts: 27
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Eric,

Yes the CSS technique is there

Will try getting it done in script too.

Thanks,
Kadaba
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic