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

Uncaught TypeError: Object [object Object] has no method 'goTo' #43

Closed
TranceGeniK opened this issue Mar 1, 2012 · 15 comments
Closed

Comments

@TranceGeniK
Copy link

Hi,

All is in the title...

var sequenceOptions = {
    autoPlay: false
    } ;
var $sequence = $('#test').sequence(sequenceOptions);
$sequence.goTo(2) ;
@IanLunn
Copy link
Owner

IanLunn commented Mar 1, 2012

Please use the following:

var sequenceOptions = {
    autoPlay: false,
    startingFrameID: 2
} ;
var $sequence = $('#test').sequence(sequenceOptions).data("sequence");

This should do exactly what you've attempted to do above. Note the data() on the end of the Sequence initiation.

@TranceGeniK
Copy link
Author

Thanks for your answer, but it isn't the purpose of this line, this was just for testing. I want to display 1 button per frame and affect an event on it to trigger transition

@IanLunn
Copy link
Owner

IanLunn commented Mar 1, 2012

Then you can do something like this:

$(".myButton").click(function(){
    $sequence.goTo(2);
});

$(".myButton2").click(function(){
    $sequence.goTo(3);
});

Let me know if that helps. Please show me the HTML you are using if it doesn't.

@TranceGeniK
Copy link
Author

That's what i've done. I tried several calls to this method but each time, my navigator (chrome or safari mobile) answered that the object hasn't got the method.
My HTML is dynamically generated by jQuery. Is that a problem ?

Did you ever had this issue?

@IanLunn
Copy link
Owner

IanLunn commented Mar 1, 2012

Can you link me to your demo please?

@TranceGeniK
Copy link
Author

--link removed--

sequence is in the "Palettes" div

@IanLunn
Copy link
Owner

IanLunn commented Mar 1, 2012

You're initiating Sequence wrong, it should be this on line 220 of grapholine.js:

var $sequence = $palettes.sequence(sequenceOptions).data("sequence");

Then on line 231, you are trying to goTo frame 2 but you haven't put the goTo within an event (such as a click event). If you remove that, Sequence will work as it should.

@IanLunn IanLunn closed this as completed Mar 1, 2012
@IanLunn
Copy link
Owner

IanLunn commented Mar 1, 2012

Closed the issue as it isn't an issue with Sequence, but feel free to comment again if you need further assistance.

@TranceGeniK
Copy link
Author

That's what i was doing in the beginning. As I said, this line is just for testing. I've written it back, but it still doesn't work... You can see it now if you want

@TranceGeniK
Copy link
Author

The event is triggered by clicking on a number button on top

@IanLunn
Copy link
Owner

IanLunn commented Mar 1, 2012

I downloaded it and there seems to have been a few modifications made to the Sequence script. If you reference the original v0.2 script, your page should work.

@TranceGeniK
Copy link
Author

Oh Sorry...
I just remebered that i changed the name of the method in sequence.js...

In the first time, I forgot .data("sequence"). It's ok now.

Thank you for all.

@IanLunn
Copy link
Owner

IanLunn commented Mar 1, 2012

No problem.

@TranceGeniK
Copy link
Author

Not related to the issue, but just wanted to say a big thank you! I've just made what I wanted and it works great!
Little tip for ios : use 3d transformations, even for 2d (like -webkit-transform: translateX(750px) to slide) to avoid performances issues. They are hardware accelerated, unlike 2d's.

@IanLunn
Copy link
Owner

IanLunn commented Mar 1, 2012

Glad you got it working and thanks for the tip.

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