Jump to content

unknown jquery code model


gongpex
 Share

Recommended Posts

Hello everyone,

I found a piece of cake jquery code such this :

	$.Animation( this, {
			x: x,
			y: y
		}, { 
			duration: speed
		}).progress( function( e ) {
			this.css( "background-position", e.tweens[0].now + "px " + e.tweens[1].now + "px" );
		});

When I looked for $.Animation and progress reference on google I didn't find it.

Q : Could y'all help me to find this reference?

Many Thanks

Link to comment
Share on other sites

If you have the rest of the source code from that page you should be able to see which libraries are being included. 

It is either a jQuery plugin or not jQuery at all.

Link to comment
Share on other sites

14 hours ago, Ingolme said:

If you have the rest of the source code from that page you should be able to see which libraries are being included. 

It is either a jQuery plugin or not jQuery at all.

Alright I will give you the full of code, tell me where is the method of JQuery according code on below :

(function( $ ) {
	$.fn.animateBgPosition = function( x, y, speed ) {
		var pos = this.css( "background-position" ).split( " " );
		
		
		this.x = parseInt( pos[0], 10 ) || 0;
		this.y = parseInt( pos[1], 10 ) || 0;
	
		$.Animation( this, {
			x: x,
			y: y
		}, { 
			duration: speed
		}).progress( function( e ) {
			this.css( "background-position", e.tweens[0].now + "px " + e.tweens[1].now + "px" );
		});
		
		return this;
	};
	
})( jQuery );

please explain to me about : tweens and now

Thanks

 

Link to comment
Share on other sites

I imagine it is part of jQuery framework, as the link said there is not much documentation on these terms specifically, as these are part of jQuerys animation() function where the user would add the required information, then the tweens(), $Animation would be used in framework background itself..

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...