Code Monkey home page Code Monkey logo

Comments (5)

matejmachac avatar matejmachac commented on May 28, 2024 1

@antoniandre Thanks for your help, we have implemented the "complex slide solution" and it works well for our use case.

from vueper-slides.

antoniandre avatar antoniandre commented on May 28, 2024

@matejmachac,
Are you trying to use one of the available events https://antoniandre.github.io/vueper-slides/#events only for one particular slide?
Or are trying to bind a click event on one particular slide?
Also what do you want to do in that click handler?

If what you want is trigger an action every time user slides to slide #3 for instance, you can use before-slide or slide and use the available params to check the slide index (refer to https://antoniandre.github.io/vueper-slides/#ex--events):

Event: "before-slide",
Params: {
  "currentSlide":{"index":0,"title":"1","titleSlot":null,"content":"","contentSlot":null,"image":""},
  "nextSlide":{"index":1,"title":"2","titleSlot":null,"content":"","contentSlot":null,"image":""}
}

Event: "slide",
Params: {
  "currentSlide":{"index":1,"title":"2","titleSlot":null,"content":"","contentSlot":null,"image":""}
}

So in the event handler you can check the current slide.index (if slide event) or nextSlide.index (if before-slide event):

if (slide.index === 3) {
  // Do sth only for slide #3.
}

from vueper-slides.

matejmachac avatar matejmachac commented on May 28, 2024

Hi @antoniandre,
we need to have either a vue router link, or a div with a click handler as the content of the slides (also we are using the background image option). Is there a way to do this?

from vueper-slides.

antoniandre avatar antoniandre commented on May 28, 2024

You can place a router link in any slide by using the provided slots: https://antoniandre.github.io/vueper-slides/#ex--complex-slide-title-and-content.
another example here: https://antoniandre.github.io/vueper-slides/#ex--updating-content.

Then if you need to make the entire slide clickable you can position it absolute in CSS for instance.

from vueper-slides.

matejmachac avatar matejmachac commented on May 28, 2024

@antoniandre we will try to implement this, thanks. Doesn't this create a potential problem with touch swiping on mobile, though (clickable div covering the entire slide)?

from vueper-slides.

Related Issues (20)

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.