I have a image under div id myimage. Now I want to resize it by using change. I want from select box if selected 700X7000 then image\'s size will be height 700px and width 7
The condition is where you can say item selected.
if( condition ) {
$('div#myimage img').css({'width' : '700px' , 'height' : '700px'});
}
else {
$('div#myimage img').css({'width' : '150px' , 'height' : '150px'});
};
Below are ways to check to see if the box is selected:
// First way
$('#checkBox').attr('checked');
// Second way
$('#checkBox').is(':checked');
Example working:
if( $('#checkBox').attr('checked') ) {
$('div#myimage img').css({'width' : '700px' , 'height' : '700px'});
}
else {
$('div#myimage img').css({'width' : '150px' , 'height' : '150px'});
};