This Js is designed to help the user when choosing items in my personal portfolio.
Whats seem to be wrong?
Cheeck out the webpage on:
http://www.lampe.se/new/index.html
Thanks!Code:window.onload = initiera; function initiera () { showCat(); } function showCat () { //FilterCategorier //-- WEB var catWebBtn = document.getElementById("webBtn") //-- PRINT var catPrintBtn = document.getElementById("printBtn"); //-- 3D var cat3dBtn = document.getElementById("tredBtn"); var catBtn = new Array(); catBtn[0] = catWebBtn; catBtn[1] = catPrintBtn; catBtn[2] = cat3dBtn; for(var i = 0; i < catBtn.length; i++) { catBtn[i].onclick = function () { var catHit = this.getAttribute("id"); alert(catHit); var thumbName = "thumbShadow" var thumb = document.getElementsByTagName("div").className = thumbName; alert(thumb.length); //Returns "11"? Should be "9". for (var j = 0; j < thumb.length; i++) { var currThumb = thumb[j]; var currThumbTitle = currThumb.getAttribute("title"); if(currThumbTitle != catHit) { currThumbTitle.style.display = "none"; } } } } }


Reply With Quote
Bookmarks