Supersized Current Slide

Hi,

I am trying to detect the third slide and then do something. After taking a look at the Supersized api, I used the following code and it is not working.

beforeAnimation : function(){
        		if(vars.current_slide == 5){
				alert("hi!");
			}
		}

Open in new window

Any help would help :)

http://promodev.accurate.ca/
AccurateDesignAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

shishir_sriCommented:
Shouldn't it be: vars.current_slide = 2;

Its not working because you don't have a slide number 5 on your page.

Slide count is from 0 to (n-1)

beforeAnimation : function(){
        		if(vars.current_slide == 2){
				alert("hi!");
			}
		}

Open in new window

0
AccurateDesignAuthor Commented:
still not working

as you can see in the code, I tried another place to insert the condition and it is not being called for some reason
0
shishir_sriCommented:
Okay. I just went through some of their docs.

Going though your code, I realized that your browser is never actually executing the above code.

I think you've provided the beforeAnimation function in the wrong place.


<link removed - GaryC123 2nd Oct 2013>
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

shishir_sriCommented:
@GaryC123

No problem. Thank you for letting me know, and pointing out the support article.
0
shishir_sriCommented:
@AccurateDesign

beforeAnimation is a theme property. Supersized API is divided into base files and theme files. You need to set the above function in your theme files.

Looking at your code, I couldn't find any references to a theme, so I'm assuming that you're using a base theme. In this case, simply create a new theme derived from the base theme.
0
AccurateDesignAuthor Commented:
Maybe can you show an embedded code example? Instead I tried putting the following code after the supersized function like you can see in the page code

  if(vars.current_slide == 2){
      alert("hi!");
  }

Open in new window

0
shishir_sriCommented:
No, not that way. Your supersized code calls on several files, one of which is:

http://promodev.accurate.ca/wp-content/themes/feather11/js/supersized.shutter.min.js?ver=1.1

This file is minified. If you open the supersized source and find the unminified file, you'll see the theme code that your slideshow is using by default.

It already has a beforeAnimation function. That is where you need to insert your code.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
AccurateDesignAuthor Commented:
if I put it in the beforeAnimation or AfterAnimation, it works only if it's not the last slide.

Also I tried to put it in the _init function but it's not working for some reason...

Do you might know why?
0
shishir_sriCommented:
According to the docs, beforeAnimation should be called before every slide.

Have you integrated the change in your webpage?
0
AccurateDesignAuthor Commented:
That is weird because for the last slide it doesn't work for some reasons. We ended up simply duplicating the last slide and make it as soon as you reach the last slide, you get redirected.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
JavaScript

From novice to tech pro — start learning today.