CodingForums.com

CodingForums.com (http://www.codingforums.com/index.php)
-   JavaScript frameworks (http://www.codingforums.com/forumdisplay.php?f=62)
-   -   jQuery Callback not working as expected in plugin (http://www.codingforums.com/showthread.php?t=285459)

Splatter 01-08-2013 02:49 PM

Callback not working as expected in plugin
 
I've been playing around with the scrollpath code (Demo: http://joelb.me/scrollpath/ Source: https://github.com/JoelBesada/scrollpath). I'm using it to make a non rotating page(probably easier ways to do it, I know) but I want to move 1 element with each page.

To do this, I have been using...(in the file scripts/demo.js)

Code:

        $.fn.scrollPath("getPath")

                // Move to 'about' element
                .moveTo(400, 300, {
                        callback: function() {
                                $(".chicken").animate({"top": "300px","left": "286px"}, 1000, "easeInOutSine");
                        },
                        name: "about"})

The problem is, it doesn't seem to trigger when I browse using the menu, but does when I browse using arrow keys(but usually only when I go backwards). Is there something glaringly stupid I am doing?

Splatter 01-10-2013 08:32 AM

Okay, I've tried a host of things, but am not getting results I expect. Is callback doing what I think it is or something different? I have now posted a copy of the site(IE users beware, I haven't formatted for IE!) at http://blah.eu5.org/ if that helps anyone as it's making me pull my hair out.

As someone new to jQuery, I think I may have bitten off more than I can chew!


All times are GMT +1. The time now is 06:53 AM.

Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.