Postings

You can freely browse the forum and post in the community forum.
However, you need a valid license to write posts for support (own a valid commercial software license or have purchased a support membership).

Posts only show once reviewed. This is mainly preventive to keep spam away. Thank you for your understanding!

Jquery doesnt work in ie and chrome

  • AlioG
  • AlioG's Avatar Topic Author
  • New Member
  • New Member
More
IP: 71.60.83.147 13 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
More
IP: 207.229.131.129 13 years 9 months ago #1682 by admin
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.
  • AlioG
  • AlioG's Avatar Topic Author
  • New Member
  • New Member
More
IP: 71.60.126.113 13 years 9 months ago #1683 by AlioG
Okay, that seems to be working, thank you very much.
More
IP: 207.229.131.129 13 years 9 months ago #1684 by admin
You are welcome!

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