question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Velocity with plain javascript does not operate if jQuery library is included

See original GitHub issue

When using plain javascript velocity operates fine with the code below, but when including the jQuery library the following code no longer works and the console logs Uncaught ReferenceError: Velocity is not defined

According to the documentation this should work with or without jQuery.

This limits us… this means we cannot mix and match javascript with jQuery and velocity.

See this fiddle: http://jsfiddle.net/1d200vh4/7/

var box = document.querySelector('.box'); Velocity(box, { scale: 2 }, { easing: "linear", duration: 500, loop: true });

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Rycochetcommented, Nov 23, 2016

See #722 for how to bypass this.

1reaction
abacajcommented, Oct 20, 2014

Thanks for the help adjusted your code to the following,

if (window.jQuery) { var V = $.Velocity; } else { var V = Velocity; }

Read more comments on GitHub >

github_iconTop Results From Across the Web

What may be the cause of the error "ReferenceError: Velocity ...
The velocity library reference should have been BEFORE the jQuery reference. The way you know this is that when you run the code,...
Read more >
Make Your Website Interactive and Fun with Velocity.js (No ...
Maria Antonietta Perna introduces Velocity JS, a super featured JavaScript library for DOM animation, and shows how to use it without jQuery ......
Read more >
Velocity.js
Overview. Velocity is an animation engine with the same API as jQuery's $.animate(). It works with and without jQuery. It's incredibly fast, and...
Read more >
5 Easy Ways to Fix the "jQuery is Not Defined" Error - Kinsta
The "jQuery is not defined" error means a call for a specific jQuery that wasn't available when the website loaded. Here's how to...
Read more >
jQuery API Documentation
jQuery is a fast, small, and feature-rich JavaScript library. ... all elements that are in the progress of an animation at the time...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found