1

I'm considering using FlexSlider 2 for an image gallery on one page of a website. FlexSlider seems to use both jQuery and a ~50kB function-defining script. I'm probably more anal about stuff like this than I need to be, but the idea of using such huge files for one little thing doesn't sit right with me.

I'm thinking of just using the most basic slider they've got:

$(window).load(function() {
  $('.flexslider').flexslider({
    animation: "slide"
  });
});

FlexSlider has a whole host of other possible functions, though, as does jQuery. What I'm wondering is if anyone has experience stripping down FLexSlider (or jQuery) for this application. I could try to go through the code and take out things by trial and error, but I don't want to mess things up.

...or would people just recommend not worrying about the size?

randomhead
  • 111
  • 1
  • The basic functionality of that script can be achieved with just a few lines of javascript (setting up a timer and changing a class) and 20-30 lines of CSS (transitions). All the extra things come from compatibility code and features that you might need or not. So it's up to you to remove the features you don't want – nice ass Dec 14 '13 at 16:32
  • Oh, I didn't realize that. I already have lots of CSS transitions and keyframes from an earlier from-scratch attempt... I was thinking that JS might have wider browser support than bleeding-edge CSS3, but if that's all it is I can mess around with it myself. Thanks! – randomhead Dec 14 '13 at 16:37
  • It does, that's one reason there's so much of it in that script. If you need to support older browsers, you'll have to keep jQuery animations – nice ass Dec 15 '13 at 18:50

0 Answers0