PDA

View Full Version : onClick closing issues in Opera



qwikad.com
03-23-2013, 05:30 AM
I have this option where after previewing an image, you can close it by clicking on the large image ( see an example here: http://qwikad.com/0/posts/6-services/ ). It works in all browsers except Opera. After a click, the large image is still visible, but if you begin to scroll, it disappears. Is there a way to fix it?





<script type="text/javascript">
function showImage(imgName) {
document.getElementById('largeImg').src = imgName;
showLargeImagePanel();
unselectAll();
}
function showLargeImagePanel() {
document.getElementById('largeImgPanel').style.visibility = 'visible';
}
function unselectAll() {
if(document.selection) document.selection.empty();
if(window.getSelection) window.getSelection().removeAllRanges();
}


function hideMe(obj) {
obj.style.visibility = 'hidden';
}

</script>



The onClick code goes like this:




onClick="hideMe(this);"

jscheuer1
03-23-2013, 06:32 AM
Looks like a bug. This appears to be a workaround:


function hideMe(obj) {
obj.style.visibility = 'hidden';
window.scrollBy(0, 1);
window.scrollBy(0, -1);
}

qwikad.com
03-23-2013, 06:52 AM
Thank you John. It's working.

I was online for 2 hours trying to solve this on my own, why didn't I come here right away???? :confused:

Again, thank you.