...

View Full Version : jQuery no conflict trouble



Idfk
01-20-2012, 07:26 PM
I currently have to run jQuery.noConflict(); so my other scripts work correctly, examples:

prototype.js
validation.js

And i have this


$( document ).ready( function() {
$( window ).scroll( function( e ) {
if( $( window ).scrollTop() > 160 ) {
$( '.navigation' ).addClass( 'fixed' );
} else {
$( '.navigation' ).removeClass( 'fixed' );
}
} );
} );

witch works when i take jQuery.noConflict(); out, but with it in it dont work and thats my main feature is there anyway round it, thanks.

DanInMa
01-20-2012, 08:03 PM
if you jsut added , then it is nto going to work, you have to either then use "jQuery" instead of "$" or assign a new chracter to initilize jquery functions.

go here: http://docs.jquery.com/Using_jQuery_with_Other_Libraries

read the section labeled: OVERRIDING THE $-FUNCTION

Idfk
01-21-2012, 10:08 AM
Thankyou very much. :)



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum