Git Product home page Git Product logo

Comments (9)

nathansearles avatar nathansearles commented on August 21, 2024

Yeah that's a good call. Just added that to the latest version.

This is how to use it:

animationComplete: function(current){
    // Current returns current slide number
    console.log(current);
}

Check out "/examples/Images with titles/" in the download for an example.

from slidesjs.

jasonbouffard avatar jasonbouffard commented on August 21, 2024

Awesome. Just to let you know I'm using: http://www.asual.com/jquery/address/ to deep-link my "slides". So on animationComplete I'm updating the virtual address.

      var pages = ['/welcome', '/products', '/services', '/about'];
      
      $.address.externalChange(function(event) {
        var goTo = event.value;
        if (goTo == '/') {
          goTo = pages[0];
        }
        $('.pagination a[rel="' + pages.indexOf(event.value) + '"]').click();
      });
animationComplete: function(current){
    $.address.value(pages[current - 1]);
}

I think we're going to need access to the goToSlide(num) method eventually. Simulating a click is not great because we'll not always have pagination turned on. I can open a new ticket for you if you'd like.

Another idea would be to have deep-linking built in? Give each slide an id that will be the virtual address? If not built in have it easily implemented with that jQuery Address plugin.

Great plugin man. I appreciate it!

from slidesjs.

nathansearles avatar nathansearles commented on August 21, 2024

Yeah I'll have to look into adding deep linking. Love what you're doing though. I would like to find an easier way to link to a specific slide like from a hash. I'll have to mess around with that. Thanks for sharing this.

from slidesjs.

nathansearles avatar nathansearles commented on August 21, 2024

I just added slide-to-slide linking and deeplink. Download the latest and check out "Linking" within the examples folder. Let me know if that works out for you.

from slidesjs.

jasonbouffard avatar jasonbouffard commented on August 21, 2024

I like where you went with it. Didn't really build it in to the plugin but left it up to the end user on how they'd like to implement it. Very cool. I think this is important especially in my case where I have the array of page names so I have pretty deep links. I didn't have to change any of my implementation code except for the rel -> href.

from slidesjs.

jasonbouffard avatar jasonbouffard commented on August 21, 2024

I guess one thing I'd like to have but not crucial is to have the ability to give each slide an id and have that used as the href="#about" or href="#welcome" instead of href="#0" and href="#1" on the pagination links. Something like that.

from slidesjs.

michaelholm avatar michaelholm commented on August 21, 2024

Hello.

I'd like to start a text box sliding within the current slide, before the slide animation begins. An example of something similar to what I'm describing is here: http://www.ibm.com/us/en/sandbox/ver2/.

It seems that the best place to do this would be in animationStart. If that's the right approach, then It would be real nice to also have the current var passed in to animationStart, too.

from slidesjs.

nathansearles avatar nathansearles commented on August 21, 2024

Good call Michael. I just added that to version 1.1.4 that'll be up a in a few. Thanks for the suggestion.

from slidesjs.

pmsaue0 avatar pmsaue0 commented on August 21, 2024

Hi I'd like some help performing an action on a particular slide when it comes up... show a badge or something, but I'm getting an uncaught exception error. for example i have:

    animationComplete: function(current){
          if(current==1) {
            $('#promo').addClass('ding');
          } else {
            $('#promo').removeClass('ding');
          }
  },

I get the error in FF: uncaught exception: [Exception... "prompt aborted by user" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: resource://gre/components/nsPrompter.js :: openTabPrompt :: line 468" data: no]

from slidesjs.

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.