tags:

views:

51

answers:

1

Is there is any Way to add height width using jquery ? Following are my code

var img = new Image();  
 // Create image
$(img).load(function(){                 
    imgdiv.append(this);
}).error(function () {  
    $('#adsloder').remove();
}).attr({ 
    id: val.ADV_ID,  
    src: val.ADV_SRC,
    title: val.ADV_TITLE,
    alt: val.ADV_ALT
});

Thanks

+1  A: 

You can call the .height() and ,.width() setters:

var img = new Image();  
 // Create image
$(img).load(function(){                 
    imgdiv.append(this);
}).error(function () {  
    $('#adsloder').remove();
}).attr({ 
    id: val.ADV_ID,  
    src: val.ADV_SRC,
    title: val.ADV_TITLE,
    alt: val.ADV_ALT
}).height(100).width(100);
Nick Craver
thanks you nick
Yashwant Chavan