English 中文(简体)
jCarousel not working in IE8
原标题:

I ve been trying to get this working for the last hour, but I can t for the life of me, so I thought i d ask here.

I have this code:

<ul id="myCarousel">
<% foreach (var date in entryDates)
   { %>
 <li>
  <div style="text-align:center;width:60px;">
     <span class="headerSpan" id="day_<%=date.ToString("dd-MM-yyyy")%>">abc</span>
  </div>
  <input class="timeInput narrow" type="text" id="time_<%= date.ToString("dd-MM-yyyy")%>"/>
  <input class="subsInput narrow" type="text" id="subs_<%=date.ToString("dd-MM-yyyy") %>"/>
 </li>
<% } %>
</ul>

<script type="text/javascript">
    $(document).ready(function() {
        $( #myCarousel ).jcarousel({
            scroll: 7,
            animation: 1000,
            buttonNextHTML: "<span id= next >Next</span>",
            buttonPrevHTML: "<span id= previous >Previous</span>"
        });
    });    
</script>

It works fine in Chrome and FireFox, but it simply will not scroll in IE.

Any ideas why not?

最佳回答

I don t see anything wrong in your code.

However on jCarousel s documentation it s written it has been tested on IE6 and 7 but not IE8:

jCarousel has been tested and works on the following browsers:

* Internet Explorer 6 (PC)
* Internet Explorer 7 (PC)
* FireFox 1.5.0.6 (PC/Mac/Linux)
* Opera 9.01 (PC/Mac)
* Safari 2.0.4 (Mac)
* Safari 3.1.0 (PC)
* Konqueror 3.4.0 (Linux)

Is it working in IE6?

For using it, I know that jCarouselLite is working in every browser.

问题回答

It does not scroll coz of this line #373 (defenition of function "get"):

return $( >.jcarousel-item-  + i, this.list);

This selector returns 0 elements, but it must be 1. If you replace that on

return $( .jcarousel-item-  + i, this.list);

you get working scroll.

">" does not work in IE6 and works with a bug in IE7. Moreover, it does not work in IE8 in my project (DOCTYPE is XHTML 1.0 Strict, document.compatMode is CSS1Compat). This says that ">" should work in IE8, but actually it does not. Hmm, looks strange.

UPD Post about wierdness of ">" in IE8.

I have used jCarousel in much projects. I think it s ok with IE 7, 8 and 9. To test that. You can go to http://sorgalla.com/jcarousel/ and try to run their examples in browsers that your code s getting problem. So you will know what the problem is.

Try to run copy on the server. On local copy IE "kill" JS-scripts





相关问题
getGridParam is not a function

The HTML: <a href="javascript:void(0)" id="m1">Get Selected id s</a> The Function: jQuery("#m1").click( function() { var s; s = jQuery("#list4").getGridParam( selarrrow )...

selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

jQuery cycle page with links

I am using the cycle plugin with pager functionality like this : $j( #homebox ) .cycle({ fx: fade , speed: fast , timeout: 9000, pager: #home-thumbs , ...

jquery ui dialog opens only once

I have a button that opens a dialog when clicked. The dialog displays a div that was hidden After I close the dialog by clicking the X icon, the dialog can t be opened again.

jConfirm with this existing code

I need help to use jConfirm with this existing code (php & Jquery & jAlert). function logout() { if (confirm("Do you really want to logout?")) window.location.href = "logout.php"; } ...

Wrap text after particular symbol with jQuery

What I m trying to do, is wrap text into div inside ll tag. It wouldn t be a problem, but I need to wrap text that appears particularly after "-" (minus) including "minus" itself. This is my html: &...

热门标签