creating a simple Js and having problem with Opera

Forums » General Opera topics » User JavaScript

You need to be logged in to post in the forums. If you do not have an account, please sign up first.

Go to last post

13. May 2010, 09:52:00

Zocky83

Posts: 2

creating a simple Js and having problem with Opera

Hey there!

I'm made a simple website with some somple javascript (jquery), but i have some problems with Opera. In FF and IE, it works correctly, but in opera, if i do specific steps, i get result that just doesn't make any sense.

ok, so first, a little explanation how page works.
You go the the page with gallery. You have various thumbnails. You click on the it, and in the same page, using JS, special DIV is shown, that covers the whole page, and shows larger image of that thumbnail in the center. It also shows button that allows you the close this large image.

Then, there is a main menu on top with 3 buttons: gallery, info and links.

Links and info doesn't open seperate page, but only shows small div (like, 300px width, 600px height) on top of the thumbnails.
____
ok, now, HTML (part that is important):

 
<div id="windowBackgroundDiv" style="display: none;">

<a href='#' id='infoMenu'><img  src='images/icons/infoMenu.gif' alt='info' /></a>
...
<div id='info' style="display: none;">
...
</div>



And JS code:
		$('#infoMenu img').click
		(
			function()
			{
				$("#info").show();
				$('#windowBackgroundDiv').hide();
				return false;
			}
		);


function displayWindow(element)
{
...
}


_________________
ok, now, the problem. The problem only ocurres if i do this:
refresh site. press on the thumnail, then press X to close it. Then press info button. Now, this is the problem. It shows both large image AND info window on top of it. when i press info button, i only call this function:
$("#info").show(); (means select element with id of 'info', and show it).

But for some reason, and again, only the first time you load page and try it, the other function, displayWindow(this one show larger image), is triggered aswell. I really don't see any logic in this. It only happens in opera, and only if you do like i said (when site is loaded, you must first click thumnail, nothing else prior to this, then close the large image, then click info). Is there something i'm doing wrong?
Also, it doesn't matter if i use default JS code, or jquery for showing, result is always this 'bug'.

I will give you link to temp site, so that you can try and see problem for yourself. Remember, when you press info, only info windows should show, not the large image.
http://93.103.71.111/sabina/nuk.php

I'm starting to suspect it might be some opera bug or something, or maybe i'm just doing something wrong. I just don't know why would it call another function just like that.

13. May 2010, 10:21:51

Zocky83

Posts: 2

ok nvm, i found a solution, tnx anyway!

Forums » General Opera topics » User JavaScript