/    Sign up×
Community /Pin to ProfileBookmark

overflow problem

Hi below is code that I found searching the net that places photos in photo album. My problem is when the number of images exceeds the size of the container. so when the user scolls down the list the large image moves up out of sight. I need to have the large image move with the scroll.

any help is create.

[code]
<!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html xmlns=”http://www.w3.org/1999/xhtml” xml:lang=”en”>
<head>

<style type=”text/css”>

a, a:visited, a:hover {color:#000;}

#container {
position:relative;
width:750px; height:600px;
background:#888; border:1px
solid #000; margin:10px auto;
font-family:verdana, arial, sans-serif;
font-size:12px;
overflow:scroll;
}

#container a.pics {
float:right; margin:10px 21px;
display:inline;
color:#000;
text-decoration:none;
border:1px solid #000;
width:100px; height:100px;
cursor:default;
clear:both;

}
#container a.pics img.thumb {

display:block;
border:0;
}

#container a.pics span {
display:none; border:0;
width:580px;
background:#bbb;
border:1px solid #fff;
text-align:center;
}
#container a.pics span img {
margin:10px auto;
border:1px solid #000;
}

#container a.pics:hover {
white-space:normal;
border:1px solid #fff;
}
#container a.pics:hover span {
display:block;
position:absolute;
left:9px;
top:10px;
z-index:10;
height:500px;
}

#container a.pics:active {
border:1px solid #fc0;
}
#container a.pics:active span {
display:block;
position:absolute;
left:9px;
top:10px;
z-index:10;
height:500px;
}

#container a.pics:focus {
border:1px
solid #fc0;
outline:0;
}
#container a.pics:focus span {
display:block;
position:absolute;
left:9px;
top:10px;
z-index:5;
outline:0;
}

#container span.info {
clear:left; display:block;
text-align:center;
line-height:20px;
margin:0;
padding:200px 0 0 0;
width:575px;
text-align:center;
color:#eee;
z-index:1;
}
#container span.info a {
color:#000;
}
#container span.info a:hover {
text-decoration:none;
}

</style>

</head>

<body>

<h2>A Photograph Gallery</h2>
<h3>Updated 18th February 2009</h3>

<div id=”container”>

<a class=”pics” href=”#nogo”><img class=”thumb” src=”gallery/TestFolder-6/thumbs/th_thanksGivinMomBDayCake_121008_0862.JPG” width=”100″ height=”100″ alt=”” />
<span><img src=”gallery/TestFolder-6/thanksGivinMomBDayCake_121008_0862.JPG” width=”450″ height=”450″ alt=”Warm to Cold” title=”Warm to Cold” /><br />Girl &amp; Mom</span>
</a>

<a class=”pics” href=”#nogo”><img class=”thumb” src=”gallery/TestFolder-6/thumbs/th_thanksGivinMomBDayCake_121008_0863.JPG” width=”100″ height=”100″ alt=”” /><span><img src=”gallery/TestFolder-6/thanksGivinMomBDayCake_121008_0863.JPG” width=”450″ height=”450″ alt=”Warm to Cold” title=”Warm to Cold” /><br />
Girl &amp; Mom</span>
<a class=”pics” href=”#nogo”><img class=”thumb” src=”gallery/TestFolder-6/thumbs/th_thanksGivinMomBDayCake_121008_0862.JPG” width=”100″ height=”100″ alt=”” />
<span><img src=”gallery/TestFolder-6/thanksGivinMomBDayCake_121008_0862.JPG” width=”450″ height=”450″ alt=”Warm to Cold” title=”Warm to Cold” /><br />Girl &amp; Mom</span>
</a>

<a class=”pics” href=”#nogo”><img class=”thumb” src=”gallery/TestFolder-6/thumbs/th_thanksGivinMomBDayCake_121008_0863.JPG” width=”100″ height=”100″ alt=”” /><span><img src=”gallery/TestFolder-6/thanksGivinMomBDayCake_121008_0863.JPG” width=”450″ height=”450″ alt=”Warm to Cold” title=”Warm to Cold” /><br />
Girl &amp; Mom</span>
<a class=”pics” href=”#nogo”><img class=”thumb” src=”gallery/TestFolder-6/thumbs/th_thanksGivinMomBDayCake_121008_0862.JPG” width=”100″ height=”100″ alt=”” />
<span><img src=”gallery/TestFolder-6/thanksGivinMomBDayCake_121008_0862.JPG” width=”450″ height=”450″ alt=”Warm to Cold” title=”Warm to Cold” /><br />Girl &amp; Mom</span>
</a>

<a class=”pics” href=”#nogo”><img class=”thumb” src=”gallery/TestFolder-6/thumbs/th_thanksGivinMomBDayCake_121008_0863.JPG” width=”100″ height=”100″ alt=”” /><span><img src=”gallery/TestFolder-6/thanksGivinMomBDayCake_121008_0863.JPG” width=”450″ height=”450″ alt=”Warm to Cold” title=”Warm to Cold” /><br />
Girl &amp; Mom</span>
<a class=”pics” href=”#nogo”><img class=”thumb” src=”gallery/TestFolder-6/thumbs/th_thanksGivinMomBDayCake_121008_0862.JPG” width=”100″ height=”100″ alt=”” />
<span><img src=”gallery/TestFolder-6/thanksGivinMomBDayCake_121008_0862.JPG” width=”450″ height=”450″ alt=”Warm to Cold” title=”Warm to Cold” /><br />Girl &amp; Mom</span>
</a>

<a class=”pics” href=”#nogo”><img class=”thumb” src=”gallery/TestFolder-6/thumbs/th_thanksGivinMomBDayCake_121008_0863.JPG” width=”100″ height=”100″ alt=”” /><span><img src=”gallery/TestFolder-6/thanksGivinMomBDayCake_121008_0863.JPG” width=”450″ height=”450″ alt=”Warm to Cold” title=”Warm to Cold” /><br />
Girl &amp; Mom</span>
</a>

<span class=”info”>Photographs<br />by kind permission of<br /><a href=”http://www.simon-pole.co.uk/”>Simon Pole</a></span>

</div>

</body>
</html>
[/code]

to post a comment
CSS

1 Comments(s)

Copy linkTweet thisAlerts:
@kprocauthorMay 05.2009 — I found a fix but explore is distorting the location

I changed position to fixed and adjusted the margins to get the object in the correct spot. Displays good in firefox but explore has the object up to high. any ideas why

<i>
</i>#container a.pics:hover span {
display:block;
position:fixed;
left:200px;
top:60px;
z-index:10;
height:500px;
}

#container a.pics:active {
border:1px solid #fc0;
}
#container a.pics:active span {
display:block;
position:fixed;
left:200px;
top:60px;
z-index:10;
height:500px;
}

#container a.pics:focus {
border:1px
solid #fc0;
outline:0;
}
#container a.pics:focus span {
display:block;
position:fixed;
left:200px;
top:60px;
z-index:10;
outline:0;
}
×

Success!

Help @kproc spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.7,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...