how to hide the image? how can i do ?
Posted
by user309381
on Stack Overflow
See other posts from Stack Overflow
or by user309381
Published on 2010-05-06T06:23:05Z
Indexed on
2010/05/06
6:28 UTC
Read the original article
Hit count: 210
function Psend() {
new Ajax.Request('Handler.ashx',
{
method: 'get',
onSuccess: function(transport) {
var response = transport.responseText || "no response text";
//alert("Success! \n\n" + response);
var obj = response.evalJSON(true);
for (i = 0; i < 4; i++) {
DeCheBX = $('MyDiv').insert(new Element('input', { 'type': 'checkbox', 'id': "img" + obj[i].Nam, 'value': obj[i].IM, 'onClick': 'SayHi(this)' }));
DeImg = $('MyDiv').insert(new Element('img', { 'id': "img" + obj[i].Nam, 'src': obj[i].IM, 'style': 'display = inline', 'onClick': 'Say(this)' }));
document.body.appendChild(DeCheBX);
document.body.appendChild(DeImg);
}
},
onFailure: function() { alert('Something went wrong...') }
});
SayHi = function(x) {
if ($(x).checked == true) {
// $('id').hide();
**$('img'+i).style.visibility = "hidden";**// doesnt work
}
};
© Stack Overflow or respective owner