jsor / jcarousel

Riding carousels with jQuery.
https://sorgalla.com/jcarousel/
MIT License
1.99k stars 734 forks source link

Internet explorer issues #753

Closed abithyzis closed 9 years ago

abithyzis commented 9 years ago

Hi,

I have two issues that I can only see on IE11 (and below probably)

  1. The plugin adds a top and left css and while in Chrome it moves the items by modifying the left value, in IE it modifies the top value. So instead of items that slide horizontally, items slide vertically. A temporary solution to that was to add top: 0 !important but there is no sliding animation any more on IE
  2. My next button calls $('.jcarousel-main').jcarousel('scroll', '+=1'); to slide by 1. This works fine in Chrome. In IE I need to click the button 5-6 times for it to work. The click event fires correctly. The weird thing is that even if I ran the javascript from the console I need to run it 5-6 times before anything moves.

I cannot recreate any of the two in a fiddle but I can provide a url (in private) so you can see the issue.

Thank you

jsor commented 9 years ago

Looks like IE has problems identifying the carousel as horizontal. Can you try to explicitly set the vertical option to false?

abithyzis commented 9 years ago

This was it! I just figured it out on my own a minute ago and I came here to post. I have been searching for a solution the whole day. Thank you for your time :)

JamoCA commented 6 years ago

I encountered this Internet Explorer bug today using jQuery 3.2.1, jCarousel v0.3.5 (2017-03-15) and IE 11.98.16299.0 (Windows 10). It works fine w/Chrome, Firefox and Edge. Clicking the next/prev or pagination triggers would correctly update the captions, button styles and the URL hash, but the images wouldn't change. Nothing we modified made any difference until we added the option vertical:false. I used IE's Developer Tools and there weren't any error message reported.

According to the documentation, If auto-detection doesn't work, you can explicitly pass the vertical option... there's no way of knowing if auto-detection works or not unless you manually test every browser & version.

What's the recommended method to handle this so that auto-detection is set to "false" for only IE? (I'm hoping to avoid parsing the user agent.) Is this the best way? (I found this method on StackOverflow.)

vertical: !(!(window.ActiveXObject) && "ActiveXObject")

Plugin-wise, is there a way to perform a check to determine whether the vertical test works and fallback to false?

jsor commented 6 years ago

I'm not sure what exactly the problem is. If you know that your carousel is vertical, setting that option doesn't do any harm. Or do i miss something?