-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
width: 0px on firefox only #1325
Comments
looks fine to me 😃 (Firefox |
Since I'm a lovely fellow and don't have the heart to just leave you hanging; 😆 $(".lightbar").remove();
$(".slick-slider").slick("refresh"); 😄 - _works now!_ I don't know why, but Firefox doesn't like your Good luck, |
It looks fine to you on the fiddle or on the website ? It works for me in the fiddle with '37.0.2' but the website still doesn't show the slides |
... mmh lol thanks :) If I hide them dat also work. Will investigate |
💃 - it _could_ still be a slick issue, but you'll have to do a bit of investigation in to why those elements cause your layout problem. And if you can update the JSFiddle to demonstrate it, that'd be awesome and we can see about fixing it! :) -- however there are some cases where the plugin will just not work due to limits in CSS/JS/Browsers 😢 Si |
i have a similar, although maybe unrelated issue. basically im using slick on an element thats inside a backbone view. now, before anyone points out that i am trying to intialize Slick on a dynamically injected element, i want to assure you that i have checked that already. i am able to get the element in question as a jQuery object and style it with CSS for example. i have also checked to make sure that i am not trying to initialize Slick twice on the same element and that i'm not removing any instances of it carelessly. so to sum up, here's what's happening: i have a mobile app with two screens - home and login screen. home is the view one with the carousel, login is a separate view. when i land on the page for the first time and Backbone starts routing, it takes me to /#home and renders the view - carousel is displaying just fine. then, when i navigate from that view to the next one (login screen), the home view is being destroyed and in it's place i render the login screen. and here's the issue: if i try to go back using the back button, or even by going to the previous URL by typing the hash manually (ie. going from /#login to /#home), the carousel gets loaded but all the widths are set to 0. here's what my view looks like:
and here's the carousel template:
any ideas? FYI, calling FYI 2, i swapped Slick for Owl Carousel temporarily and everything works fine - which tells me that there's an issue with Slick itself rather than my code. BTW this happens in all browsers. |
@goodpixels , thanks for the contribution :) - really there's nothing I can think of without seeing some code... if you would like some help to resolve it, go ahead and fork this JSFiddle and try to get a very simple version of your problem running (with backbone) 😃 |
here's a codepen: http://codepen.io/anon/pen/doGWPB/left/?editors=001 |
this looks like a possible answer: #235 yet it still sucks! i've solved it temporarily by doing this:
...but I hate it! 1 ms!!! |
it really works with 1ms ? - does backbone do any requestAnimationFrame DOM-update caching to maintain 60fps? ... I know some libraries will try to catch all dom-manipulation and store them for the next animation frame... that would perhaps explain why it cannot calc widths until 1ms later. Sorry to say it's just a limitation of the technology... Not a slick issue, but please keep us posted with any updates as I know many people suffer this kind of thing! 🙇 |
if might be better, to wrap your event-trigger in the timeout, instead? :) |
nah, i got some other stuff which relies on that event, and i am quite happy with the fact that it triggers so early after render :))) anyway, yeah, that 1ms delay does the trick. considering this example, i think it would make sense to introduce another option to Slick, which would force width & height upon initialization. how does that sound? |
You mean like: $(el).slick({ width: 320, height: 100 }); ❓ 💭 |
yes. and i think they should accept either an integer or a function for maximum flexibility. |
heh... I see the reasoning 😃 , but still the irony of a responsive carousel having fixed-width as an option smacks me hard in the face. 😆 😝 - that's a pretty heavy amount of work that I'm not keen to take on, @kenwheeler would need to consider this. 🐒 |
Hi @Baccanno |
with: 100% |
Hi,
First of all thank you for this plugin. It works perfectly well on IE 11 / Chrome / Opera.
However on Firefox the width of .slick-track and .slick-slides is very small ( 0px, 1px, 13px ) and no images is displayed. I saw some related issue but none with the solution
you can look at it on www.synchromthegame.com (sorry for the unintended publicity)
Here is my init code
slick 1.5.3
The text was updated successfully, but these errors were encountered: