Code Monkey home page Code Monkey logo

flickity-fade's Introduction

Flickity fade

Fade between Flickity slides

Install

Add flickity-fade.css to you stylesheets and flickity-fade.js to your scripts.

Download

CDN

<!-- CSS -->
<link rel="stylesheet" href="https://unpkg.com/flickity-fade@2/flickity-fade.css">

<!-- JS -->
<script src="https://unpkg.com/flickity-fade@2/flickity-fade.js"></script>

Package managers

  • npm: npm install flickity-fade
  • Yarn: yarn add flickity-fade

Usage

Enable fade behavior by setting fade: true in Flickity options.

// jQuery
let $carousel = $('.carousel').flickity({
  fade: true,
});
// vanilla JS
let flkty = new Flickity( '.carousel', {
  fade: true,
});
<!-- HTML -->
<div class="carousel" data-flickity='{ "fade": true }'>
  ...
</div>

Webpack

const Flickity = require('flickity');
require('flickity-fade');

let flkty = new Flickity( '.carousel', {
  fade: true,
});

This feature spent four years in feature-request purgatory. Never give up.

By Metafizzy ๐ŸŒˆ๐Ÿป

flickity-fade's People

Contributors

desandro avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

flickity-fade's Issues

Fade Speed

Would be great to be able to set the fade transition speed, similar to how you can set the speed of the slider with selectedAttraction and friction.

NPM Usage Question

Hi, appreciate the work on this! I am a bit confused how to use this with standard webpack builds.

Question

If using import Flickity from "flickity-fade". Can I initialize all of my flkty instances with that import and will they behave just like import Flickity from "flickity".?

I ask because I'm using code splitting and would like to keep my instance imports the same across my application regardless of if they are using the slide or fade effect.

Investigation

From looking at the code it appears you are requiring the main Flickity package and returning it. So we should technically be able to just use this package to initialize but I'd like to double check.

Suggestion

I would make this section of the readme clearer for those users that want to use a combination of fade and slide effects across their site. I.E if a user is using a combination of fade and slide effects they have to install both packages but can initialize all instances with 'flickity-fade'.

Fade on desktop while slide on mobile

Hello! I used this code to override the default slide:

.flickity-slider{ transform: none !important; }
.cell {
left: 0 !important;
opacity: 0;
transition: "opacity 0.3s ease-in-out";
}
.cell.is-selected{
opacity: 1;
}

This though overrides slide on both mobile and desktop. How can I make larger screens to still be on fade while mobile to use slide?
Thanks!

Fade autoplay stop working on click

Thanks for the plugin! Unfortunately, the slideshow stops autoplaying as soon as I click on it.
pauseAutoPlayOnHover = false doesn't have an effect, neither does draggable = false.

Any workaround for this?

[Bower] Not installing

Hi,

If you run bower install flickity-fade --save

I've just getting an empty directory.

Thanks,
Tom

Flickity fade slide error

Please help, I got this error when using flickity-fade package (with cdn)

Here is the css cdn package

<link rel="stylesheet" href="https://unpkg.com/flickity@2/dist/flickity.min.css">
<link rel="stylesheet" href="https://unpkg.com/flickity-fade@2/flickity-fade.css">

Here is the carousel html and the script set up
<div class="testimonial-carousel">
....carousels div....
</div>

<script src="https://unpkg.com/flickity@2/dist/flickity.pkgd.min.js"></script>
<script src="https://unpkg.com/flickity-fade@2/flickity-fade.js"></script>
<script>
$('.testimonial-carousel').flickity({
// options
fade: true,
cellAlign: 'left',
contain: true,
prevNextButtons: false
});
</script>

i don't figure out why this slide fade not working, only run in the dom like i am using normal flickity package but, it shown error like img below
image

wrapAround incompatibility with a 2-slide carousel

When there are two slides and wrapAround option is true, the fade is mucked up. It looks like the opacity values are being set as a negative number for one slide (0 ... -1) and values above 1 for the other slide (1 ... 2). The result is that the carousel immediately jumps to the next slide rather than fading.

Test case: https://codepen.io/jnicol/pen/daVWQB

If there are 3 or more slides then the issue is not present.

When using asNavFor, fade stops working (Webpack)

Hi, I'm using webpack and when I attempt to use flickity-fade with flickity-as-nav-for, fade breaks and it reverts back to a swipe.

When I remove flickity-as-nav-for, fade starts working again.

Thanks

Typescript Support

Not really a bug, but I am having troubled using this package along with Typescript. I only found @types for the main flickity package but not for this one.

Cannot find module 'flickity-fade'.ts(2307)

Any help/direction would be very helpful. TIA

Fade issue with negative progress

Should the progress variable be abs to prevent a case where it may be negative. This would result in 1 - (- progress) a value greater than 1.

fadeSlideA.setOpacity( 1 - progress );

I don't have exact steps to replicate this issue but this was the outcome after tracing the issue a -progress.

Flickity fade not working

Please help, I got this error when using flickity-fade package

gambar

My init
gambar

Flickity work fine but fade in not working

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.