Hello,
I’ve sent a picture via peer connection in chrome, I’ve a little problem with hiding an icon image and here’s my codes:
HTML:
<img src='' id=notification onclick="viewImage();" />
<div id=view>
<center>[name] sent you an image!</center>
<img id=view_image><br>
<button onclick="viewTheImage();">View</button>
<button id=cancel>Cancel</button>
</div>
{css}
#view {
display: none;
}
#view_image {
thumbnail
}
Javascript:
notification = document.getElementById('notification'),
notification.src = 'images/no_image.png';
function viewTheImage() {
window.location = 'image.php?image_id=' +ID;
}
function canCel() {
view.style.display = 'none';
}
function createPeerConnection() {
// my BlahBlahBlah code goes here
function gotImage() {
notification.src = 'images/got_image.png';
}
}
cancel = document.getElementById('cancel');
cancel.addEventListener('click', canCel, false);
Long code to give you the picture but I just want the notification image returned to ‘no_image.png’ when the user click ‘Cancel’.
How do I do this? I use this code and it’s not working:
function canCel() {
view.style.display = 'none';
notification.src = 'images/no_image.png';
}
Thanks,