Difference between revisions of "Team:Tuebingen/Art and Design"
Line 47: | Line 47: | ||
function createCarousel() { | function createCarousel() { | ||
var carousel = document.getElementById('carousel'); | var carousel = document.getElementById('carousel'); | ||
+ | var slots = []; | ||
carousel.style.cssText = 'width:100%;height:150px;text-align:center;overflow:hidden;'; | carousel.style.cssText = 'width:100%;height:150px;text-align:center;overflow:hidden;'; | ||
for (var i=0;i<imgURLs.length;i++) { | for (var i=0;i<imgURLs.length;i++) { | ||
+ | var div = document.createElement('div'); | ||
var img = document.createElement('img'); | var img = document.createElement('img'); | ||
− | img.style.height = ' | + | img.style.height = '100%;' |
− | img.style.width = ' | + | img.style.width = '100%'; |
− | + | div.style.cssText = 'float:left;width:100px;height:150px;display:none;'; | |
img.src = imgURLs[i]; | img.src = imgURLs[i]; | ||
+ | div.appendChild(img); | ||
+ | div.image = img; | ||
+ | slots.push(div); | ||
carousel.appendChild(img); | carousel.appendChild(img); | ||
} | } | ||
+ | slots[0].style.display = 'block'; | ||
+ | slots[0].style.perspective = '150px'; | ||
+ | slots[0].img.style.rotateY = '45deg'; | ||
+ | slots[1].style.display = 'block'; | ||
+ | slots[1].style.perspective = '150px'; | ||
+ | slots[1].img.style.rotateY = '0deg'; | ||
+ | slots[2].style.display = 'block'; | ||
+ | slots[2].style.perspective = '150px'; | ||
+ | slots[2].img.style.rotateY = '-45deg'; | ||
} | } | ||
Revision as of 14:18, 18 September 2015
<
>
Supercellfie Ironcell Culk Thor Cellson Yeasteye Captain Cellmerica Black Cellow