Mega Slider calling next slide from outside of plugin

cfraser's picture
Wed, 02/08/2017 - 00:39
Mega Slider calling next slide from outside of plugin

I have a issue whereby I need to move to the next slide in the slideshow using a custom jquery script without modifying the exiting codebase.

It is possible to call/trigger the next slide in the slideshow? and if so could someone please provide the method that we should be calling to achieve this?

Many thanks

stardothosting's picture
Thu, 02/16/2017 - 13:08

You have to use jQuery to modify the bullet point slide change items. What I did was I used jQuery to find the bullet points, and then change them to text links that appear below the slider. You can obviously use anything (images ,etc). The key is that it has to be done this way because Mega Slider has its own jQuery that calls the slide change function (something I didnt want to edit).

Heres my code below, I put it on the page template where the slider appears. My code pulls the ALT tag of the slide background image and uses it as a text link instead of those bullet points. i then used CSS to re-position where the links appear (I wont post that because thats somewhat easier) :

jQuery(window).load(function($) {
        jQuery(".md-slide-item").each(function() {
                var altname = jQuery(this).data('thumb-alt');
                var slidernum = jQuery(this).attr('class').match(/ slide-(\d*)/)[1];
                slidernum = slidernum - 1;
                if (altname != 'first') {
                        altnav = altname;
                } else {
                        altnav = 'Slide ' + slidernum;
                jQuery('.md-bullet[rel="' + slidernum + '"]').html('<a class="custom-slider-bullet">' + altnav + '</a>');

phuonght's picture
Mon, 02/27/2017 - 05:31


Can you please tell us which version of your slider?

Log in or register to post comments
Have More Idea?

We are here to build your website!

No Universal solution fits all special business requirements. Our experienced team is ready with ideas and state-of-the-art technical solutions to consult the best solution within your budget.