PDA

View Full Version : Down Image Magic


Savarona
01-12-2007, 07:45 AM
Hi,

I have two layer (in fact six :)) like in below. When my mouse over of them, the rollover images of them active (down images). And when mouse out of the layers the original images of them active . What i want to be is when i click one of the layers (the original images active after the clicking the layers and i don't want to be like this-thanks for your help, iframe works) they must stay in down images. (until i click the other layer)

when i click the other layer, clicked first layer must turn to it's original image and second clicked layer must active (after clicking) it's down image and must save it's image until i click another layer.

I tried to explain the problem as clear as possible.
Thanque
Teşekkürler

<div id="Layer11" style="position: absolute; left: 249px; top: 186px; width: 24px; height: 147px; z-index: 8"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('hakkımızda','','LAYERHAKKIMIZDAust.j pg',1)" onclick="document.getElementById('orhit').src='CEVIZZYen.ht ml';"><img src="LAYERHAKKIMIZDA.jpg" alt="About_us" name="hakkımızda" width="25" height="147" border="0" id="hakkımızda" /></a></div>


<div id="Layer14" style="position: absolute; left: 158px; top: 212px; width: 27px; height: 121px; z-index: 11"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Etkilesim','','LAYERETKILESIMust.jpg ',1)" onclick="document.getElementById('orhit').src='banner.html' ;"><img src="LAYERETKILESIM.jpg" alt="Contact_Us" name="Etkilesim" width="27" height="121" border="0" id="Etkilesim" /></a></div>

kate
01-13-2007, 08:20 PM
Hello,

Trying to make sense of your code here.

<div id="Layer11" style="position: absolute; left: 249px; top: 186px; width: 24px; height: 147px; z-index: 8"><a href="#" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('hakkımızda','','LAYERHAKKIMIZDAust.j pg',1)" onclick="document.getElementById('orhit').src='CEVIZZYen.ht ml';"><img src="LAYERHAKKIMIZDA.jpg" alt="About_us" name="hakkımızda" width="25" height="147" border="0" id="hakkımızda" /></a></div>

<a href="#"onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('hakkımızda','','LAYERHAKKIMIZDAust.j pg',1)"

In DW you should search the site instead of leaving this empty, maybe.

<a href="#" How is DW going to find your image, unless it works different if its DW8. It would be more helpful if you could explain a bit more. Normally you must allow DW to look for the image on the defined site folder, then it will produce the correct address for the link.

Savarona
01-17-2007, 04:58 PM
what i want to do is exactly use navigation bar, but my layers (images) is not the same line. They have different coordinates. So how can i solve this problem?

davidj
01-17-2007, 05:31 PM
<a href="#" How is DW going to find your image


kate

<a href="#" is correct syntax for using an onclick within an <a tag.

domedia
01-17-2007, 05:51 PM
DW uses href="#" all the time, but it doesn't necessarily make it right.
The anchor tag is supposed to be used for links. The HREF attribute needs to contain a URI. I kind of feel that Dreamweaver is supporting misuse of the anchor tag, because it's so common in DW. The only time # is allowed in the href attribute is when it is referencing an ID or NAME like this <a href="#top">Go back to top</a>, the browser will then jump up to whichever ID you've set to 'top'. Without anything else than '#', most browsers are looking for a non-existing element on the page, and just scroll up to the top of the document. Sucks if the link was way down on the page ;)

If you simply want to make something clickable (to change images), use a regular onclick like you're doing now, and add a custom CSS cursor to the element. That way the cursor changes so the user knows there's an action on the element.

because of browser differences in implementation (go figure..) you have to declare the CSS property twice for cross browser compatibility:
cursor:pointer;
cursor:hand

davidj
01-17-2007, 06:00 PM
yes

<a href="#" is a hack and was obviously discovered through requirement

i think if you misuse something which is adopted by the masses then it becomes the way to do it.

<table has probably become the most missused element in HTML after it was only ever intended to be used for displaying tabular data

davidj
01-17-2007, 06:15 PM
addition...

dreamweaver endorse extensions that use <a href="#"

if it works across browsers without negative effects then it becomes the norm. There are loads of examples of this. Look at lists used in navigation. You cant tell me that was the intention of that tag! Its a perversion just like <a="#"

domedia
01-17-2007, 06:55 PM
Yes I can, and I do :)

You're a programmer and supposed to like specs, go read the HTML protocol ;)

Just because you can do something the wrong way, doesn't make it right. (tables for layout, javascript site navigation etc)

and most experts agree that lists are semantically right to use for lists (until a more semantically correct <nav> tag comes along)

domedia
01-17-2007, 07:05 PM
To the original question:

Savarona,

-Make sure each link has a name in the properties window when you highlight the links.
-Then use the Image Swap behavior, and add a 'onClick' function. This will specify what is going to happen when you click on the link.
-Change the image for the current link to it's down status -and- change the image used for all the other links (you'll see a list of the names you gave them earlier), to their UP status.

davidj
01-17-2007, 07:15 PM
i have to disagree

i think the web is flexable and it allows for such ingenuity and imagination.

if a solution works and doesnt have any negative effects then the reason for it being right or wrong is not important as they are words which have no meaning. if someone was to say to me "dont smoke in that dynamite factory" because its wrong i would understand that statement but if someone said to me dont paint that wall blue because its wrong then unless something was going to happen and it was my wall i would carry on painting! This is what makes us adapt and probably the reason we evolved. When that first monkey picked up the first bone to use as a tool. His mate didnt say "err thats a bone.. dont start bashing that sabretooth tiger coz its wrong" he would have just clonked the bugger.

if a technique becomes popular and it works and is globaly adopted then it becomes the way. Whether it was intended or not

its like spoken languages. Every year new words are added to dictionaries that were never recognised in the past. This year there words last year they were not but whatever you call them (right or wrong they work and they are used)

Savarona
01-18-2007, 04:57 PM
Domedia, i think your way is logical. I will try to do whatever is necesseray with your illuminating way.

I want to thank all of you for your comments about this topic.