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

If the slider only contains one slide, it will generate an error #1

Open
abstractic opened this issue Oct 4, 2012 · 9 comments
Open

Comments

@abstractic
Copy link

If the slider only contains one slide, it will generate an error, please see line 23 and the row:

this._originalFlexsliderWrapupFunction = this._flexslider.wrapup;

@syncnet
Copy link

syncnet commented Jan 25, 2013

If you only have one slide then you shouldn't be using a slider in the first place. Just place your image and you are done!

@markirby
Copy link
Owner

Yes! Indeed!

Mark

On 25 Jan 2013, at 22:07, syncnet [email protected] wrote:

If you only have one slide then you shouldn't be using a slider in the first place. Just place your image and you are done!


Reply to this email directly or view it on GitHub.

@abstractic
Copy link
Author

Well, I can't control how many slides my customers choose to use, so in the case where they only use one slide, the slider generates an error. I think it's lame, to not control what happens if you remove all slides except one, so that's it.

@abstractic
Copy link
Author

For your information. You only need to check that the flexslider not are undefined, before you initialize it. A simple solution could be:

if (this._flexslider != undefined) {
this._originalFlexsliderWrapupFunction = this._flexslider.wrapup;
this._defaults = defaults;
this._name = flexsliderManualDirectionControls;
this.init();

}

@markirby
Copy link
Owner

Thanks, although I think you shouldn't need to use this anymore, since the update to FlexSlider which allows manual controls to be used.

Cheers,

Mark

On 28 Jan 2013, at 12:26, Richard Persson [email protected] wrote:

For your information. You only need to check that the flexslider not are undefined, before you initialize it. A simple solution could be:

function FlexsliderManualDirectionControls( element, options ) {
this.element = element;
this.options = $.extend( {}, defaults, options) ;
this._flexslider = $(element).data('flexslider');

if (this._flexslider != undefined) {

this._originalFlexsliderWrapupFunction = this._flexslider.wrapup;
this._defaults = defaults;
this._name = flexsliderManualDirectionControls;

this.init();

}
}


Reply to this email directly or view it on GitHub.

@abstractic
Copy link
Author

There are still not any support for custom controls in the new FlexSlider, so your code is still, very useful for those who like to move the controls out from the slider element.

Cheers,
Ricki

@markirby
Copy link
Owner

Oh - interesting, I was mistaken. Glad it was worth the effort then!

On 28 Jan 2013, at 12:35, Richard Persson [email protected] wrote:

There are still not any support for custom controls in the new FlexSlider, so your code is still, very useful for those who like to move the controls out from the slider element.

Cheers,
Ricki


Reply to this email directly or view it on GitHub.

@mgratch
Copy link

mgratch commented Jan 30, 2013

Currently you can change the controlNav but not the directionNav.

@abstractic agreed.

@CHEWX
Copy link

CHEWX commented Sep 25, 2014

Yup, another +1 for the code. No idea why you cannot customise directionNav but you can controlNav - very dis-jointed.

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

No branches or pull requests

5 participants