-
Notifications
You must be signed in to change notification settings - Fork 22
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
Slimmage with slideshows #4
Comments
In theory, Slimmage should be able to handle the image even if it (or a parent) has However, if the CSS that sets the Try calling this method after the slideshow cycles each time, it may help.
It's better, however, if you can make sure all the images are present in the DOM at startup and have the max-width setting already applied. If this doesn't help, consider setting up a minimal example with just Slimmage + Cycle2 and sharing it here so we can perform debugging. |
I made three fiddles with various levels of success: First the slidshow does not work. I think the issue is that cycle is seeing the noscript so it doesn't find any slides. Second, I put the images inside a div so that the slideshow begins. The images are 160px. If I resize the window, the current image gets slightly larger. Third, I tried the call you suggested (hopefully I implemented it correctly). The images seem to get one size bigger each time they cycle until they finally get to full size. |
Slimmage needs to run prior to Cycle2, as Cycle2 clones DOM nodes, employes absolute positioning, and generally makes max-width evalualtion impossible. Essentially, for any library that
That library needs to wait until after slimmage.js runs. A method for Cycle2 is to disable auto-intialization, and run Slimmage during the bootstrap stage before Cycle can mess things up. $( '.slides' ).on('cycle-bootstrap', function( event, opts ) { |
That works, thanks! As a note, at first I was getting errors when I implemented that method because I was using slimmage.min.js. I switched to slimmage.js and it worked. Amazing work on this. Thanks! |
Hello! I'm dusting this thread off... I'm facing a very similar issue as mwentz did, and I've been following the thread to solve it. We're using ImageResizer along with Slimmage, and serving the images in a Cycle 2 slideshow. I know the images are being rendered, but they're not showing up for me. I just want to confirm whether or not your fiddle is still valid. I took a look at it, and the results are empty—which is what I'm getting too. ;) Thanks in advance. |
The approach is still valid, but ensure you use the latest version of slimmage.
|
I am trying to use Slimmage and SlimResponse (with ImageResizer) with jquery Cycle2. Slimming is happening after Cycle2 is being initialized which is causing various issues. Depending on how I set up the slideshow and css, I am getting either no slideshow or the images after the first one are 160px.
I have the same issue with the Bootstrap Carousel, all the images after the first one are 160px. I'm guessing this is happening because the of the display:none on all but the first image.
The text was updated successfully, but these errors were encountered: