Cześć
Widziałem gdzieś ostatnio kod żeby wstawić galerię na allegro.
Niestety nie mogę tego znaleźć.
Czy ktoś z Was może wie gdzie mogę taki znaleźć / ma taką galerię?
Głównie zależy mi na tym żeby było duże zdjęcie, a pod nim miniaturki, które po kliknięciu / najechaniu wyświetlają się jako duże zdjęcia (w tym dużym zdjęciu) i z ustawionym pierwszym zdjęciem jako głównym.
Ważne jest żeby opierało się to tylko na HTML i CSS bez innych technologii. Bez @media (allegro tez blokuje)
Edit 11.07.2016 - Rozwiązany
<!DOCTYPE html>
.container {
margin: 0 auto;
position: relative;
width: 500px;
height: 400px;
background: #ffffff;
background-image: url("http://www.mwallpaper.com/images/battlefield_3_640x480_8099.jpg"); /* First image */
background-size: 640px 480px;
width: 640px;
background-repeat: no-repeat;
padding-top: 500px;
}
.thumbnail {
margin-left: 1px;
margin-right: 1px;
width: 100px;
height: 80px;
cursor: pointer;
display: inline-block;
}
.picture {
position: absolute;
top: 0;
right: 0;
width: 640px;
height: 480px;
}
#thumbnail-1 {
background-image: url("http://www.mwallpaper.com/images/battlefield_3_640x480_8099.jpg"); /* image thumbnail */
background-size: 100px 80px;
}
#picture-1 {
background-image: url("http://www.mwallpaper.com/images/battlefield_3_640x480_8099.jpg"); /* image */
background-size: 640px 480px;
display: none;
}
#thumbnail-1:hover ~ #picture-1 {
display: block;
}
#thumbnail-2 {
background-image: url("http://i1.tribune.com.pk/wp-content/uploads/2016/01/1034342-image-1453787012-930-640x480.jpg"); /* image thumbnail */
background-size: 100px 80px;
}
#picture-2 {
background-image: url("http://i1.tribune.com.pk/wp-content/uploads/2016/01/1034342-image-1453787012-930-640x480.jpg"); /* image */
background-size: 640px 480px;
display: none;
}
#thumbnail-2:hover ~ #picture-2 {
display: block;
}
#thumbnail-3 {
background-image: url("http://media.breitbart.com/media/2016/04/game_of_thrones_season_6_jon_snow-640x480.jpg"); /* image thumbnail */
background-size: 100px 80px;
}
#picture-3 {
background-image: url("http://media.breitbart.com/media/2016/04/game_of_thrones_season_6_jon_snow-640x480.jpg"); /* image */
background-size: 640px 480px;
display: none;
}
#thumbnail-3:hover ~ #picture-3 {
display: block;
}
<div class="thumbnail" id="thumbnail-1"></div> <div class="picture" id="picture-1"></div> <div class="thumbnail" id="thumbnail-2"></div> <div class="picture" id="picture-2"></div> <div class="thumbnail" id="thumbnail-3"></div> <div class="picture" id="picture-3"></div>
Działa po najechaniu (hover).
Wersja z klikaniem gdzieś się blokuje. Poniżej zamieszczam kod. Może ktoś poprawi i będzie dla potomnych

<!DOCTYPE html>
.container {
margin: 0 auto;
position: relative;
width: 500px;
height: 400px;
background: #ffffff;
background-image: url("http://www.mwallpaper.com/images/battlefield_3_640x480_8099.jpg"); /* First image */
background-size: 640px 480px;
width: 640px;
background-repeat: no-repeat;
padding-top: 500px;
}
.thumbnail {
margin-left: 1px;
margin-right: 1px;
width: 100px;
height: 80px;
cursor: pointer;
display: inline-block;
}
.picture {
position: absolute;
top: 0;
right: 0;
width: 640px;
height: 480px;
}
#thumbnail-1 {
background-image: url("http://www.mwallpaper.com/images/battlefield_3_640x480_8099.jpg"); /* image thumbnail */
background-size: 100px 80px;
}
#picture-1 {
background-image: url("http://www.mwallpaper.com/images/battlefield_3_640x480_8099.jpg"); /* image */
background-size: 640px 480px;
display: none;
}
#thumbnail-1:hover ~ #picture-1, #thumbnail-1:focus ~ #picture-1 {
display: block;
}
#thumbnail-2 {
background-image: url("http://i1.tribune.com.pk/wp-content/uploads/2016/01/1034342-image-1453787012-930-640x480.jpg"); /* image thumbnail */
background-size: 100px 80px;
}
#picture-2 {
background-image: url("http://i1.tribune.com.pk/wp-content/uploads/2016/01/1034342-image-1453787012-930-640x480.jpg"); /* image */
background-size: 640px 480px;
display: none;
}
#thumbnail-2:hover ~ #picture-2, #thumbnail-2:focus ~ #picture-2 {
display: block;
}
#thumbnail-3 {
background-image: url("http://media.breitbart.com/media/2016/04/game_of_thrones_season_6_jon_snow-640x480.jpg"); /* image thumbnail */
background-size: 100px 80px;
}
#picture-3 {
background-image: url("http://media.breitbart.com/media/2016/04/game_of_thrones_season_6_jon_snow-640x480.jpg"); /* image */
background-size: 640px 480px;
display: none;
}
#thumbnail-3:hover ~ #picture-3, #thumbnail-3:focus ~ #picture-3 {
display: block;
}
<a href="#" class="thumbnail" id="thumbnail-1" tabindex="1"></a> <div class="picture" id="picture-1"></div> <a href="#" class="thumbnail" id="thumbnail-2" tabindex="2"></a> <div class="picture" id="picture-2"></div> <a href="#" class="thumbnail" id="thumbnail-3" tabindex="3"></a> <div class="picture" id="picture-3"></div>
Ten post edytował michaf1994 11.07.2016, 16:46:39