SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Thread: class swap

  1. #1
    SitePoint Zealot
    Join Date
    Jan 2005
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    class swap

    I'm trying to get the header cells of a table to do simple rollovers. But as you can imagine microcrap isn't wanting to play nice with IE.

    Code:
    <td class="table-header" onmouseover="this.className='tablesortable';" onmouseout="this.className='table-header';">
    With IE 7 you don't get the class to work. It swaps out the first class but doesn't add the onmouseover class. Am i missing something here or is this just another reason to hate IE?

    Thanks

  2. #2
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can you supply a link to the page as seems to work when i test it with sample page below.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
    <head>
    	<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
    	<title>Page Title</title>
    	<style type="text/css" media="screen">
    		.table-header{font-weight:bold;}
    		.tablesortable{}
    	</style>
    </head>
    <body>
    	<table border="0" cellspacing="5" cellpadding="5">
    		<tr>
    			<td class="table-header" onmouseover="this.className='tablesortable';" onmouseout="this.className='table-header';">
    					test
    			</td>
    		</tr>
    	</table>
    </body>
    </html>

  3. #3
    SitePoint Zealot
    Join Date
    Jan 2005
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hmm the page is in a secured server within the company network so i can't provide a link. However since your worked with the exact same approach it can only mean i'm chasing the wrong thing and that i need to be looking at whats killing it.

    Thanks!

  4. #4
    SitePoint Enthusiast
    Join Date
    Nov 2006
    Posts
    68
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Did the code I supplied work for you if so then its probably one off the css rules that is effecting you page.

  5. #5
    SitePoint Zealot
    Join Date
    Jan 2005
    Posts
    147
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    if i ran in stand alone it worked fine. But it's not working in the page that i'm trying to use it in. So i'm going to have to figure it out. thanks for your help though.


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
  •