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
精彩评论