fix hasTransitions when the script is placed in <head> (jsfiddle)