Quantcast
Channel: .ready not working in real website but it works in jsFiddle - Stack Overflow
Viewing all articles
Browse latest Browse all 3

.ready not working in real website but it works in jsFiddle

$
0
0

I'm working on a website and I use this flipboard: http://jsfiddle.net/9yyVd/1490/.

Instead of letting it work on click, how it is originally coded, I changed the click to .ready. But that doesn't work in the webpage. I think it's because I have 2 .ready's in one jquery document now? Anyway, I don't now.

Now my code looks like this:

target.ready(function(e) {            var next = fill(texts[k].split('')),                prev = fill(target.data('prev').split('')),                print = prev;            $.each(next, function(i) {                if (next[i] == prev[i]) {                    return;                }                var index = alph.indexOf( prev[i] ),                    j = 0,                    tid = window.setInterval(function() {                        if ( next[i] != arr[index] ) {                            index = index == alph.length-1 ? 0 : index + 1;                        } else {                            window.clearInterval(tid);                        }                        print[i] = alph[index];                        render(print);                }, options.speed)            });            k = k == texts.length-1 ? 0 : k + 1;        });

It works fine in the fiddle but when I implement it in the website, it doesn't work anymore. You can see the sourcecode here: http://www.babyq.be

So the goal is to let the flipboard flip when the page loads or when 'box5' is selected.

I hope someone can help.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images