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

Feature request: Make it possible to navigate (got to) to a particular slide index #848

Open
Edgar-Saavedra opened this issue Nov 28, 2017 · 1 comment

Comments

@Edgar-Saavedra
Copy link

While looking into seeing if I could implement a custom dot navigation in colorbox (in addition to using the previous/next navigation), I realized that two very simple methods could help implement this and potentially allow user to do other kinds of customization of their own.

I was thinking something along the following lines would be helpful to add to the 1.x plugin

         /**
	 * To get all elements in a particular grouping
	 * user can use $.data(element, 'colorbox') to
	 * get the rel group of a particular element.
	 * @param { String } rel the current grouping string/label
	 */
	publicMethod.getRelated = function(rel) {
		return getRelated(rel);
	};

	/**
	 * Tell colorbox to go to a particular slide index
	 * could be used in conjunction with publicMethod.getRelated()
	 * to get related length
	 * @param { int } index 
	 */
	publicMethod.gotoSlide = function(index) {
		if($related && $related[index])
			launch($related[index]);
	};

@jackmoore Let me know how if there are better/other ways to do this. Or if this would be useful functionality to add to the 1.x branch of the plugin. An if so, let me know how I could go about doing a pull request.

@EliezerB123
Copy link

EliezerB123 commented Feb 7, 2021

+1.

A goToIndex function would be great! Right now we only have "Next" and "Previous".

There's already an open pull request for this, but it's 8 years old....:

#377

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

2 participants