Don't know anything about javascript really so need a bit of help. This is for the ocuk collage (link in sig). At the moment it uses php to read all the images and echos them. Now what I want is to use the method at http://www.devarticles.com/c/a/JavaScript/Creating-PopUp-Notes-with-CSS-and-JavaScript-Part-I/2/ to have little floaty notes. The problem is in the javascript. I don't know how to make it recursive for every element in the array. The js is:
Seems to me that all the yellow numbers need to increment up to the number of pictures in the collage.
note1, note2, note3... are unique id's of divs with the persons username in it. a1, a2, a3... are unique ids of pics corresponding to the note. So you mouse over a pic and it does the javascript for that particular picture/note pair, displaying the username when moused over the relevant pic.
Is this possible?
Code:
createNotes=function(){
showNote=function(){
// gets note1 element
var note[COLOR=Yellow]1[/COLOR]=document.getElementById('note[COLOR=Yellow]1[/COLOR]');
// assigns X,Y mouse coordinates to 'note1' element
note[COLOR=Yellow]1[/COLOR].style.left=event.clientX;
note[COLOR=Yellow]1[/COLOR].style.top=event.clientY;
// makes note1 element visible
note[COLOR=Yellow]1[/COLOR].style.visibility='visible';
}
hideNote=function(){
// gets note1 element
var note[COLOR=Yellow]1[/COLOR]=document.getElementById('note[COLOR=Yellow]1[/COLOR]');
// hides note1 element
note[COLOR=Yellow]1[/COLOR].style.visibility='hidden';
}
var a[COLOR=Yellow]1[/COLOR]=document.getElementById('a[COLOR=Yellow]1[/COLOR]');
// shows note1 element when mouse is over
a[COLOR=Yellow]1[/COLOR].onmousemove=showNote;
// hides note element when mouse is out
a[COLOR=Yellow]1[/COLOR].onmouseout=hideNote;
}
// execute code once page is loaded
onload=createNotes;
note1, note2, note3... are unique id's of divs with the persons username in it. a1, a2, a3... are unique ids of pics corresponding to the note. So you mouse over a pic and it does the javascript for that particular picture/note pair, displaying the username when moused over the relevant pic.
Is this possible?