Skip to content
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

Mousewheel event does not work #380

Closed
jrodbet opened this issue Oct 7, 2020 · 8 comments
Closed

Mousewheel event does not work #380

jrodbet opened this issue Oct 7, 2020 · 8 comments
Assignees
Labels
🔖3.x v3.x~ related issue ❓Question Asking question about @egjs/Flicking stale

Comments

@jrodbet
Copy link

jrodbet commented Oct 7, 2020

When I try to scroll with the mouse wheel the carousel does not work (scroll). There is some property to activate this?

@WoodNeck WoodNeck self-assigned this Oct 7, 2020
@WoodNeck WoodNeck added 🔖3.x v3.x~ related issue ❓Question Asking question about @egjs/Flicking labels Oct 7, 2020
@WoodNeck
Copy link
Member

WoodNeck commented Oct 7, 2020

Hello, @jrodbet!
We're preparing for that feature, you can't do that at the moment.
There's a demo for that feature, but it uses Flicking's private properties.

@jrodbet
Copy link
Author

jrodbet commented Oct 7, 2020

Hi @WoodNeck,
Thanks for your quickly reply!
I was wondering if there is some way to implement that feature (like the demo) with React. Do you know if there is some demo like this for React?
Thanks :)

@WoodNeck
Copy link
Member

WoodNeck commented Oct 8, 2020

@gamtiq gamtiq mentioned this issue Nov 26, 2020
16 tasks
@stale
Copy link

stale bot commented Dec 19, 2020

This issue/PR has been automatically marked as stale because it has not had any update (including commits, comments, labels, milestones, etc) for 30 days. It will be closed automatically if no further update occurs in 7 day. Thank you for your contributions!

한글 이 이슈/PR은 commits, comments, labels, milestones 등 30일간 활동이 없어 자동으로 stale 상태로 전환되었습니다. 이후 7일간 활동이 없다면 자동으로 닫힐 예정입니다. 프로젝트 개선에 기여해주셔서 감사합니다.

@stale stale bot added the stale label Dec 19, 2020
@stale stale bot closed this as completed Dec 26, 2020
@fullyherge
Copy link

Hi, opening this up again to ask; is this something that is now better supported in v4? Can't find any information elsewhere, but I might be missing something obvious?

Thanks

@devadaviddd
Copy link

devadaviddd commented Apr 27, 2024

Hi you could using this one to scroll using your mouse wheel @fullyherge

import Flicking from '@egjs/react-flicking'
import { useEffect, useRef } from 'react'

export default function PostList() {
  const postCarouselRef = useRef<Flicking>(null)

  useEffect(() => {
    document.body.addEventListener('wheel', onWheelChange)
  }, [])

  const onWheelChange = (e: WheelEvent) => {
    if (postCarouselRef.current) {
      const postCarousel = postCarouselRef.current
      const cameraPosition = postCarousel.camera.position
      postCarousel.control.controller.axes.setTo(
        { flick: cameraPosition + e.deltaY },
        0
      )
    }
  }

  return (
    <Flicking
      circular={true}
      horizontal={false}
      className="w-full h-3/4"
      ref={postCarouselRef}
    >
      <div className="w-full h-1/2 bg-black m-2"></div>
      <div className="w-full h-1/2 bg-black m-2"></div>
    </Flicking>
  )
}

chrome_fE1foSgTad

@klich3
Copy link

klich3 commented Jun 14, 2024

According to the comments, here is the plugin that you can install from NPM, it also has the possibility to scroll horizontally.
plugin

npm i egjs-flicking-plugins-wheelslide

Regards

@Omnistas
Copy link

Omnistas commented Jun 19, 2024

For Vue 3 or Nuxt 3 (with <Flicking ref="flicking">...</Flicking>):

import Flicking from "@egjs/vue3-flicking"
import "@egjs/vue3-flicking/dist/flicking.css"

const flicking = ref(null)

onMounted(() => {
    flicking.value.element.addEventListener("wheel", (e) => {
        e.preventDefault();

        flicking.value.control.controller.axes.setTo({
            flick: flicking.value.camera.position + e.deltaY
        }, 0)
    })
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🔖3.x v3.x~ related issue ❓Question Asking question about @egjs/Flicking stale
Projects
None yet
Development

No branches or pull requests

6 participants