Alright, here's the rest. Once you have this set up, I would just ask that you give me credit on your page, perhaps with a link to my website.
Anyway, that script is only part of the code. You'll need this as well, either in a separate CSS stylesheet, or between <style> tags.
Code:
.image_scroller
{
position: absolute;
border: 1px solid #165117;
background: #202020;
top: 480px;
min-height: 138px;
height: 138px;
}
#scroller_body
{
left: 335px;
width: 500px;
}
#scroll_content_wrapper
{
position: absolute;
left: 5px;
top: 4px;
width: 490px;
height: 130px;
padding: 0px 0px 0px 0px;
overflow: hidden;
}
#scroll_content
{
position: absolute;
top: 0px;
left: 0px;
width: 5000px;
height: 130px;
white-space: nowrap;
}
#sr_button
{
cursor: pointer;
width: 30px;
left: 845px;
}
#sl_button
{
cursor: pointer;
width: 30px;
left: 295px;
}
.thumbnail
{
cursor: pointer;
display: inline;
margin-right: 5px;
}
.thumbnail_img_off
{
border: 1px solid #808080;
}
.thumbnail_img_on
{
border: 1px solid #FFFFFF;
}
#image_viewer_wrapper
{
display: none;
position: absolute;
z-index: 3;
left: 250px;
top: 175px;
width: 690px;
text-align: center;
}
#image_viewer
{
position: relative;
margin-left: auto;
margin-right: auto;
background: #000000;
border: 1px solid #E0E0E0;
}
#closelink
{
font-size: 12px;
position: absolute;
top: 5px;
right: 5px;
padding: 2px 2px 2px 2px;
border: 1px solid #E0E0E0;
background: #101010;
}
#viewer_image_wrapper
{
position: absolute;
top: 0px;
left: 0px;
}
#loading_msg
{
position: absolute;
display: block;
left: 0px;
right: 0px;
top: 20px;
text-align: center;
color: #808080;
}
Now, here's the part that actually goes in your page:
Code:
<div class="image_scroller" id="sr_button"><img src="sr.gif" alt="Scroll right" onmouseover="rightMouseover(this);" onmouseout="rightMouseout(this);"></div>
<div class="image_scroller" id="sl_button"><img src="sl.gif" alt="Scroll left" onmouseover="leftMouseover(this);" onmouseout="leftMouseout(this);"></div>
<div class="image_scroller" id="scroller_body">
<div id="scroll_content_wrapper">
<div id="scroll_content"><div
class="thumbnail"><img class="thumbnail_img_off" id="th0" src="towerth.gif" onclick="viewImage(0)" alt="" onmouseover="this.className='thumbnail_img_on'" onmouseout="this.className='thumbnail_img_off'"></div><div
class="thumbnail"><img class="thumbnail_img_off" id="th1" src="laketh.gif" onclick="viewImage(1)" alt="" onmouseover="this.className='thumbnail_img_on'" onmouseout="this.className='thumbnail_img_off'"></div><div
class="thumbnail"><img class="thumbnail_img_off" id="th2" src="observatoryth.gif" onclick="viewImage(2)" alt="" onmouseover="this.className='thumbnail_img_on'" onmouseout="this.className='thumbnail_img_off'"></div><div
class="thumbnail"><img class="thumbnail_img_off" id="th3" src="spaceshipth.gif" onclick="viewImage(3)" alt="" onmouseover="this.className='thumbnail_img_on'" onmouseout="this.className='thumbnail_img_off'"></div><div
class="thumbnail"><img class="thumbnail_img_off" id="th4" src="spacestationth.gif" onclick="viewImage(4)" alt="" onmouseover="this.className='thumbnail_img_on'" onmouseout="this.className='thumbnail_img_off'"></div><div
class="thumbnail"><img class="thumbnail_img_off" id="th5" src="spaceship2th.gif" onclick="viewImage(5)" alt="" onmouseover="this.className='thumbnail_img_on'" onmouseout="this.className='thumbnail_img_off'"></div><div
class="thumbnail"><img class="thumbnail_img_off" id="th6" src="templeth.gif" onclick="viewImage(6)" alt="" onmouseover="this.className='thumbnail_img_on'" onmouseout="this.className='thumbnail_img_off'"></div><div
class="thumbnail"><img class="thumbnail_img_off" id="th7" src="spaceship3th.gif" onclick="viewImage(7)" alt="" onmouseover="this.className='thumbnail_img_on'" onmouseout="this.className='thumbnail_img_off'"></div>
</div>
</div>
</div>
<script type="text/javascript">initScroller();</script>
Notice that on each image has id thn, where n starts counting from zero, and that the onclick event for each image is viewImage(n), where n is the same as in the images id.
You'll also need a 1 pixel transparent image called blank.gif, which is the default image for the viewer. I used that because in some browsers, reassigning the src attribute of an image isa bit slow if the image hasn't loaded yet, and I was getting a momentary "flicker" of the previous image when the viewing window popped up.
You can just use mind if you want.
www.blake-foster.com/blank.gif
Finally, in the js file, you'll need to adjust the initScroller() function to match the names of your image files, and you'll need to change the numImages variable to match the number of images you have.
EDIT:
I forgot to mention, the scroll images should be called sl.gif and sr.gif (the arrows). You'll also need to change some widths and heights here and there. The height of both the scroller and the scroll buttons is controlled here:
Code:
.image_scroller
{
position: absolute;
border: 1px solid #165117;
background: #202020;
top: 480px;
min-height: 138px;
height: 138px;
}
The width of the buttons is controlled here:
Code:
#sr_button
{
cursor: pointer;
width: 30px;
left: 845px;
}
#sl_button
{
cursor: pointer;
width: 30px;
left: 295px;
}
Bookmarks