SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict Owz2004's Avatar
    Join Date
    Mar 2004
    Location
    U.K (Wales)
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    jquery Accordion not working in I.E 8

    Hi, I'm having an issue with my Jquery Acorddion, it does not seem to work in I.E8 but works fine in chrome and firefox.

    I have initialised the acordion using the following code:

    Code JavaScript:
    <script language="javascript" type="text/javascript">
    	$(function(){
    		$('#accordion .head').click(function() {
    			$(this).next().toggle('slow');
    			return false;
    		}).next().hide();
    	});
    </script>

    The acordion html structure is as follows:

    Code HTML4Strict:
     
    <div id="accordion">
              <h3 class="head">Main Header</h3>
    <div class="innerContent">
                    <h3>Title</h3>
              	<li><a href="#somelink" title="S">link1</a></li> 
                    <li><a href="#somelink" title="S">Link2</a></li> 
                    <li><a href="#somelink" title="S">Link3</a></li> 
                    <li><a href="#somelink" title="S">Link4</a></li> 
      </div>
              <h3 class="head">Main Header</h3>
    <div class="innerContent">
                    <h3>Title</h3>
              	<li><a href="#somelink" title="S">link1</a></li> 
                    <li><a href="#somelink" title="S">Link2</a></li> 
                    <li><a href="#somelink" title="S">Link3</a></li> 
                    <li><a href="#somelink" title="S">Link4</a></li> 
      </div>
              <h3 class="head">Main Header</h3>
    <div class="innerContent">
                    <h3>Title</h3>
              	<li><a href="#somelink" title="S">link1</a></li> 
                    <li><a href="#somelink" title="S">Link2</a></li> 
                    <li><a href="#somelink" title="S">Link3</a></li> 
                    <li><a href="#somelink" title="S">Link4</a></li> 
      </div>
    </div>

    it displays as expected in firefox but not i.e 8

    Any ideas why?

    thanks

  2. #2
    SitePoint Addict Owz2004's Avatar
    Join Date
    Mar 2004
    Location
    U.K (Wales)
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I.E is saying that an object was expected on line 8..

    line 8 is as follows:

    $('#accordion .head').click(function() {

    am I referencing something wrong?

  3. #3
    SitePoint Addict Owz2004's Avatar
    Join Date
    Mar 2004
    Location
    U.K (Wales)
    Posts
    213
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Can anyone help?

    I'm pulling my hair out here trying to get this to work..


Tags for this Thread

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
  •