Closed (fixed)
Project:
Flex Slider
Version:
7.x-2.x-dev
Component:
Flex Slider Library
Priority:
Minor
Category:
Bug report
Assigned:
Reporter:
Created:
9 Mar 2013 at 22:10 UTC
Updated:
13 Aug 2015 at 19:54 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
mist commentedI resolved this issue by editing flexslider\assets\js\flexslider.load.js
and changing selectors at line 35 and 36:
to
Comment #2
minoroffense commentedCan you post the markup generated by your views for your sliders?
Comment #3
maartendeblock commentedI had the same issue and the above fix worked.
This is the generated html:
Comment #4
minoroffense commentedMy issue with changing the selector from direct child to any child is that if you have another image in the slide which you want to retain a certain size it will be removed. Mind you, probably shouldn't be doing so with img tag attributes.
I'll mull it over.
Comment #5
minoroffense commentedComment #6
maartendeblock commentedTo others with the same problem:
Flexslider assumes you have ul, li, and img directly nested without any divs in between. But Drupal/Views really (really, really) likes to wrap fields in divs.
You can change this by:
1) clicking your field, open 'Style settings', click 'Customize field HTML' en setting it to - None -.
2) clicking 'Settings' next to 'Fields' in 'Format' and uncheck 'Provide default field wrapper elements'
If you don't use fields, but you use 'Content', try using the Display Suite module. It has options to remove a lot of divs (I haven't tested it with flexslider yet).
Comment #7
philosurfer commented#6 Works.
Comment #8
dzepol commented#6 works as long as your showing just an image. When you tell the image to link to content the anchor tag causes the same problem.
Comment #9
dzepol commented#1 works for me. Allows for link to content while maintaining aspect ratio.
Comment #10
hansfn commentedI just want to confirm comment 8 - the fix in comment 6 is fine as long as your showing just an image. When you want the image to link somewhere (like you very often want with a slideshow), the problem is back.
I ended up editing sites/all/modules/flexslider/assets/js/flexslider.load.js (like in comment 1) but less intrusive - replacing
with
Comment #11
guguss commentedI confirm that #10 worked for me.
Here is a patch which handles that on the latest 2.x Dev version.
Comment #12
minoroffense commentedComment #13
jamescook commentedI haven't researched this thoroughly but I wonder if this is related to
https://drupal.org/node/1927818
Image Styles Have no affect on flexslide images.
Comment #14
minoroffense commentedThe selector on the javascript may need to be adjusted as in #10. Though if we remove the child marker, we remove the height value from ALL images, not just the first one in the slide (or direct child images).
Maybe there's a better way or a way to tell the JS which images to clear the height attr from. Or just remove from all and assume that the images are set to the right size as #10 does.
Comment #15
timqallen commentedJust want to throw in there that I was having issues with the aspect ratio, but I also had this issue https://drupal.org/node/2017219. I had a faulty installation, and reinstalling the module fixed everything!
EDIT: the reinstallation fixed the initially loaded image aspect ratio, but did not fix the resizing issue.
Comment #16
robcarrPatch at #11 doesn't seem to work (tried in in FF and Chrome)
Comment #17
robcarrMy bad, seems to target the height and width attributes. All feels a bit delicate, though...
Comment #18
minoroffense commentedComment #19
jordan8037310 commentedI can confirm this patch works with 7.x-2.0-alpha3
Comment #20
SchwebDesign commentedpatch in 11 worked for me. I think this should be committed soon. It was a huge headache to try and fix in CSS until i found this thread :) thanks for this patch!
Comment #21
hansfn commentedWell, it's confirmed by two users - setting issue to RTBC.
Comment #22
minoroffense commented