Code Monkey home page Code Monkey logo

Comments (6)

KevinBatdorf avatar KevinBatdorf commented on August 15, 2024

you might be able to do this:

<a href="#1" data-liquidslider-ref="slider-1 slider-2">moves both sliders</a>

from liquidslider.

jhudstone avatar jhudstone commented on August 15, 2024

Thank you for the quick response, but that doesn't seem to do the trick. I wonder about a single jquery function that controls more than one slider? How do I refer to a slider in such a function?

from liquidslider.

KevinBatdorf avatar KevinBatdorf commented on August 15, 2024

You could do that as well, but this should work. It works for me just fine. Do you have crossLinks set to true on both sliders?

from liquidslider.

jhudstone avatar jhudstone commented on August 15, 2024

Yes. When I tried this link, it didn't change either slider, although both:

<a href="#1" data-liquidslider-ref="slider-1">Slider 1</a> and

<a href="#1" data-liquidslider-ref="slider-2">Slider 2</a>

worked.

I have to admit I am an oldschool js guy who is just gettting into jquery. If I wanted to change to link in js I could create a function something like this:

function 2sliders() {
document.getElementById("slider1").href = "http://example.com/#1";
document.getElementById("slider2").href = "http://example.com/#1";
}

What would the jquery eqivalent be?

from liquidslider.

KevinBatdorf avatar KevinBatdorf commented on August 15, 2024

not sure why it doesnt work. It seems to work fine in my demo that's included with the slider. Did you try it there?

You can try to use this inside your function instead:

function 2sliders() {
  var sliderObject1 = $.data( $('#slider-1')[0], 'liquidSlider');
  var sliderObject2 = $.data( $('#slider-2')[0], 'liquidSlider');
  sliderObject1.setCurrent(1);
  sliderObject2.setCurrent(1);
}

from liquidslider.

jhudstone avatar jhudstone commented on August 15, 2024

This worked great, thanks!

from liquidslider.

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.