CSS-Tricks / AnythingSlider

A jQuery Slider plugin for anything.
http://css-tricks.github.io/AnythingSlider/
GNU Lesser General Public License v3.0
1.15k stars 380 forks source link

Anything Slider not displaying at all in Chrome or IE7, fine in everything else. #571

Closed nccadm closed 9 years ago

nccadm commented 11 years ago

Hi,

I love this AnythingSlider, but I cant get it to display at all in Chrome or IE7. It works fine in everything else.

Ive set the images:

slider img {

width: 243px; height: 177px; }

Here is the link: http://www.norwich.gov.uk/pages/Test-slider.aspx

Can anyone help?

Thanks for your time!

JamyGolden commented 11 years ago

That links to a 404 page for me.

nccadm commented 11 years ago

Hi Jamy,

Thanks for looking. Can you try it now please?

Someone suggested that this might have something to do with it: http://stackoverflow.com/questions/8476356/ie-doesnt-parse-xml-response-text-using-jquerys-find-properly but Im not sure how to amend the script accordingly, or if that is even the right track.

nccadm commented 11 years ago

I have solved this, thanks to the hint I mentioned above, which got me thinking. I changed responseText to responseXML on the 4th line below.

function renderSlides(xData, status) 
{
  $(xData.responseXML).find("z\:row").each(function() {
  var liHtml = "<li>" + $(this).attr("ows_SlideContents") + "</li>";
    $("#slider").append(liHtml);
});
$('#slider').anythingSlider();

}

nccadm commented 11 years ago

Its not working in Safari, or android mobile - any suggestions?

nccadm commented 11 years ago

Seems that changing responseText to responseXML fixed it for IE7 and earlier but breaks it for Safari, Chrome and Opera.

So what I need to do is make it say responseXML if it's IE7 and earlier, and responseText if it's anything else.

I thought perhaps I could use conditional comments and copy the code into a new file called responseXML.js and add it into the conditional comment for lte IE7, like this:

<!--[if lte IE 7]> 
<link href="anythingslider-ie.css" rel="stylesheet" type="text/css" media="screen"/>
<script type="text/javascript" src="responseText.js"></script>
<![endif]--> 

But it didn’t work.

How can I have responseXML if it's IE7 and earlier, and responseText if it's anything else?

Mottie commented 11 years ago

Hi @nccadm!

Sorry for taking so long to respond.

Is this still an issue? Did you try putting the actual responseXML code within the conditional comments (not just the script)?

Also, make sure you're not using <!-- comments --> within the javascript code, that is for HTML comments only. Javascript comments use slash-asterisk blocks /* comment */ or double slashes // comment (don't add code after this comment on the same line).