[jQuery] Cannot set height or width of div
I am simply trying to set the height and width of a div.
I have included the dimensions.js file as well a jQuery
I can get the height and width - just cannot set it.
Please help.
//Swaps current div with ajax loader div
function showAjaxLoader(divToReplace){
var dtr = document.getElementById(divToReplace);
var w = $(dtr).width();
var h = $(dtr).height();
$('div.ajaxLoader').width(w);
$('div.ajaxLoader').height(h);
alert(w + ' ' + h);
}
Also tried this:
//Swaps current div with ajax loader div
function showAjaxLoader(divToReplace){
var dtr = document.getElementById(divToReplace);
var w = $(dtr).width();
var h = $(dtr).height();
$('div.ajaxLoader').css('width',w);
$('div.ajaxLoader').css('height',h);
alert(w + ' ' + h);
}