Hi, I figured a couple of things out by my own.
And the buttons are now working onClick this way:
html
Code:
<span id='first' class="selected"><a href="#1" onclick="first()">1 </a></span>
<span id='secondo' class="normal"> <a href="#2" onclick="second()">2 </a></span>
and so on for 3 4 5 6
the "second()" function in javascript
Code:
function second() {
document.getElementById("first").setAttribute("class" , "normal");
document.getElementById("second").setAttribute("class" , "selected");
}
And this works good. I thought about checking the y position of the window with window.onscroll and call the same functions but it doesnīt work. The problem is that the pictures are in an absolute positioned DIV with overflow-y:auto. So when you scroll you donīt actually scroll the window but the DIV.
Is there a way to control in javascript the scroll of a DIV?
Or is there anything else I should change?
Please help!
Bookmarks