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

Added slidechange event & a few methods which may or may not be useful... #119

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prehensile
Copy link

  • A 'slidechange' event is now emitted when the slide changes.
  • Added a toggleControls method with a public accessor on $wrapper.
  • Added a play method with a public accessor on $wrapper.
  • Added a stop method with a public accessor on $wrapper.

These were all added because I needed to hide the controls & display a play button on the first slide (with automatic set to false), and then show them again on subsequent slides. I also wanted to stop the slideshow after the loop came round.

Thought this stuff may prove useful upstream if it's not too specific to my use case.

@jelmerdemaat
Copy link

+1 for the slidechange event. Would be very useful. Hope this gets pulled.

@kalidhasPerumal31
Copy link

Hi,

Iam using bjqs-1.3.js and i tried slide change event but it is not fired, Can anyone help me invoke the
slide change event.

in document.ready i have done the following.

$("#slider12345").on("slidechange", function () {
alert();
});

and i am creating slider using the following code,

$('#slider12345').bjqs({
// width and height need to be provided to enforce consistency
// if responsive is set to true, these values act as maximum dimensions
'width': sliderBarWidth,
'height': 285,

    // animation values
    'animtype': 'slide', // accepts 'fade' or 'slide'
    'animduration': 500, // how fast the animation are
    'animspeed': 5000, // the delay between each slide
    'automatic': true, // automatic

    // control and marker configuration
    'showcontrols': false, // show next and prev controls
    'centercontrols': false, // center controls verically
    'nexttext': 'Next', // Text for 'next' button (can use HTML)
    'prevtext': 'Prev', // Text for 'previous' button (can use HTML)
    'showmarkers': false, // Show individual slide markers
    'centermarkers': false, // Center markers horizontally

    // interaction values
    'keyboardnav': true, // enable keyboard navigation
    'hoverpause': true, // pause the slider on hover

    // presentational options
    'usecaptions': false, // show captions for images using the image title tag
    'randomstart': false, // start slider at random slide
    'responsive': true // enable responsive capabilities (beta)
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants