javascript - skrollr plugin to convert colors -


i'm trying write plugin skrollr allow transitions between different kinds of colors annotations.

this code @ moment:

http://jsfiddle.net/nl75k/

it should run before skrollr , convert every color annotation hsla.

i don't understand why console gives me 3 times same results:

background-color:hsla(56,100,50,  1); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(0,100,50, 0.5); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(0,100,50, 1); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(56,100,50,  1); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(0,100,50, 0.5); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(0,100,50, 1); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(56,100,50,  1); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(0,100,50, 0.5); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(0,100,50, 1); fiddle.jshell.net/nl75k/show/:117 

it should be:

background-color:hsla(56,100,50,  1); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(0,100,50, 0.5); fiddle.jshell.net/nl75k/show/:117 background-color:hsla(0,100,50, 1); fiddle.jshell.net/nl75k/show/:117 

any idea?

in getalldataelements iterating on elements , on attributes. each data attribute you're adding elements matches. div has 3 data attribute, causes added 3 times.

simple fix: break loop

//check if attibute name starts "data-" if (attr.indexof("data-") == 0) {     matches.push(element); //add matches     break; } 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -