Are you enjoying the extensions? Did you like the support? Help others decide.

Leave a review

exclamation-circle Jquery doesnt work in ie and chrome

More
11 years 9 months ago #1681 by AlioG
I have a piece of code that sizes an element written in jquery:

$(document).ready(function(){
var width = $('#contenttd').width();
if(width > 2000){
$('#toplog').width(width);
}
});

It works fine in firefox but doesn't work in chrome or ie and the javascript console doesnt show any errors.
I could really use some help

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #1682 by admin
Replied by admin on topic Re: Jquery doesnt work in ie and chrome
Hello,
it probably depends on what else in on your page. For instance, if you have MooTools libraries loaded, this will fail because MooTools will take over the '$' of jQuery.
If that is the case, use
jQuery.noConflict();
and replace the first line of your code with
jQuery(document).ready(function($) {

Olivier.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #1683 by AlioG
Replied by AlioG on topic Re: Jquery doesnt work in ie and chrome
Okay, that seems to be working, thank you very much.

Please Log in or Create an account to join the conversation.

More
11 years 9 months ago #1684 by admin
Replied by admin on topic Re: Jquery doesnt work in ie and chrome
You are welcome!

Olivier.
The following user(s) said Thank You: mvaughan

Please Log in or Create an account to join the conversation.