WIKI使用導(dǎo)航
站長(zhǎng)百科導(dǎo)航
站長(zhǎng)專(zhuān)題
- 網(wǎng)站推廣
- 網(wǎng)站程序
- 網(wǎng)站賺錢(qián)
- 虛擬主機(jī)
- cPanel
- 網(wǎng)址導(dǎo)航專(zhuān)題
- 云計(jì)算
- 微博營(yíng)銷(xiāo)
- 虛擬主機(jī)管理系統(tǒng)
- 開(kāi)放平臺(tái)
- WIKI程序與應(yīng)用
- 美國(guó)十大主機(jī)
Gallery:外觀主題:AutoRC JavaScript
來(lái)自站長(zhǎng)百科
This is the JavaScript source code for the AutoRC Theme.
/** * Set sidebar or album container height to the taller of the two */ function setWidthHeights() { var sidebar = document.getElementById('sidebar'); var album = document.getElementById('album'); // Photo page var photo = document.getElementById('photo'); if (photo) { var photoWidth = album.offsetWidth - sidebar.offsetWidth; photo.style.width = (photoWidth - 18) + 'px'; // Album page } else { var item = getElementsByClassName('item', 'div'); var albumWidth = album.offsetWidth - sidebar.offsetWidth; var columns = Math.floor(albumWidth / item[0].offsetWidth); var difference = albumWidth - (columns * item[0].offsetWidth); var newItemWidth = (difference / columns) + item[0].offsetWidth - 18; for (var i=0; i<item.length; i++) { item[i].style.width = newItemWidth + 'px'; } } // Set sidebar height and album/photo container heights equal if (sidebar.offsetHeight > album.offsetHeight) { album.style.height = sidebar.offsetHeight + 'px'; } else { sidebar.style.height = album.offsetHeight + 'px'; } } function getElementsByClassName(cssclass, element) { var arr = new Array(); var elem; var elems = document.getElementsByTagName(element); for (var cls, i = 0; (elem = elems[i]); i++ ) { if (elem.className == cssclass) { arr[arr.length] = elem; } } return arr; }