I currently have a small working JS gallery (onmouseover). The code is below. What I would like to achieve is the small images, only a few being displayed at a time. I have found a youtube video of the affect I would like to achieve: video
HTML (code omitted):
<div id="imagecontent">
<img id="about_mojang" src="images/about_mojang_small.jpg" alt="Plain Mojang Logo">
<img id="about_lego" src="images/about_lego_small.jpg" alt="Minecraft Lego">
<img id="about_cteam" src="images/about_cteam_small.jpg" alt="Cartoon of the Mojang team">
<img id="about_minecraftmojang" src="images/about_minecraftmojang_small.jpg" alt="Minecraft logo of Mojang">
<img id="about_team" src="images/about_team_small.jpg" alt="Photo of the Moajgn team">
<img id="about_wall" src="images/about_wall_small.jpg" alt="A wall in the Mojang office">
</div>
<div id="bigimage"></div>
<script>window.onload=addImages() ;</script>
</body>
JS (code omitted):
function showPic(i_element) {
var source = i_element.getAttribute("id") ;
source = "images/"+source+".jpg" ;
var alt = i_element.getAttribute("alt") ;
var i = document.createElement("img") ;
i.setAttribute("src",source) ;
i.setAttribute("alt",alt) ;
var placeholder = document.getElementById("bigimage") ;
if (placeholder.childNodes.length != 0 )
{ placeholder.removeChild(placeholder.childNodes[0]); }
placeholder.appendChild(i) ;
}
// add the onclick event to the DOM
function addImages() {
var item = document.getElementById("imagecontent").getElementsByTagName("img") ;
for (var i=0 ; i<item.length ; i++) {
item[i].onmouseover = function() {showPic(this) ; } ;
}
}
check jsfiddle output: http://jsfiddle.net/srinivasan/EfyKe/
try something like this