//this global array contains all the names of the various hidden //content/items divs, as chronological entries in an associative array. var masterIdList = new Array('zero', 'bio-about_this_site', 'bio-about_digital_noah', 'resume-resume', 'contact-contact', 'links-links', 'web_dev-rhymatron', 'web_dev-sandbox3', 'web_dev-beth', 'web_dev-becky', 'data_viz-dow_jones_3d', 'data_viz-sound_spiral', 'data_viz-3d_video', 'data_viz-primes', 'data_viz-lab_on_chip', 'data_viz-3d_modeling', 'data_viz-student_work', 'ind-turtles', 'ind-crayola', 'ind-timex_pillow', 'ind-timex_pod', 'ind-camera', 'food-japanese', 'food-baking', 'hacking-hackintosh', 'hacking-hacking', 'bikes-bikes'); //this function adds back content to the visible items div and //replaces the buttons on the navi dot strip function addItems(id_){ var api = $('#scrollable').data('scrollable'); var selector0 = '.' + id_; id_2 = '#hidden_ .' + id_; api.addItem($(id_2)); var numberOfElements = $(selector0).size(); if(numberOfElements==1){ $('.navi').fadeTo(1,0.01); } else { $('.navi').fadeTo(1,1.0); } for(i = 0; i < numberOfElements; i++){ var insertcode = '
  • '; $(insertcode).appendTo('.navi'); } api.begin(); api.focus(); } //this function works with the .seek() function to allow // anchors to trigger scrollable movements function goto(id_){ var api = $('#scrollable').data('scrollable'); api.seekTo(id_); } function navbar0(activeId){ for(var i = 1; i < 4; i = i + 1){ var navbar = '#navbar' + i; var listname = '#xli' + i; if(i==activeId){ $(navbar).fadeIn(); $(listname).addClass('actives'); } else { $(navbar).hide(); $(listname).removeClass('actives'); } } } function navbar1(activeId){ var firstTabs = new Array(); firstTabs[0] = 'bio-about_digital_noah'; firstTabs[1] = 'resume-resume'; firstTabs[2] = 'contact-contact'; firstTabs[3] = 'links-links'; firstTabs[4] = 'web_dev-rhymatron'; firstTabs[5] = 'data_viz-dow_jones_3d'; firstTabs[6] = 'ind-turtles'; firstTabs[7] = 'food-japanese'; firstTabs[8] = 'hacking-hackintosh'; firstTabs[9] = 'hacking-hacking'; firstTabs[10] = 'bikes-bikes'; $('#footer_text').fadeIn(); for(var i = 0; i < 11; i = i + 1){ var listname = '#li' + i; //example: 1li1; if(i==activeId){ $(listname).addClass('actives'); } else { $(listname).removeClass('actives'); } } $('#footer').fadeIn(1000); $('#content').slideUp(450, function(){ swap_class(activeId); var url = 'ajax_tabs.php?id=' + activeId; $.get(url, function(data){ $('#main_navi').html(data); tabs_($('#main_navi li:nth-child(1)'), firstTabs[activeId], 0); $('#content').slideDown(1000); }); }); } //this function adds to the navi dot strip, allowing it to //mark which scrollable page is active function navi_activator(scrollable_index){ var arg = '.navi li:nth-child(' + scrollable_index + ')'; $('.navi > li').removeClass('active') $(arg).addClass('active') } function preload_content(){ var url = 'ajax.php?'; $.get(url, function(data){ $('#hidden_').html(data); data = 'All content is now loaded.'; $('#loading').html(data); $('#loading').fadeOut(1500); }); } //this function removes content from visible div and places it //back in the hidden div. It also removes the nav buttons //from the top unordered list. function removeItems(id_){ var api = $('#scrollable').data('scrollable'); var totalLength = masterIdList.length; for (i = 0; i < totalLength; i++){ if(masterIdList[i] != id_){ var id_iter = '.items .' + masterIdList[i]; $(id_iter).appendTo('#hidden_'); $(id_iter).remove(); } } $('.navi li').remove(); } //this function triggers the remove and add scripts for //swapping out content in the scrollables->items div function swapper(id_){ removeItems(id_); addItems(id_); } function swap_class(id_){ if(id_ == 1){ $('div #page').removeClass('page_'); $('div #scrollable').removeClass('scrollable_'); $('div #page').addClass('resume_page'); $('div #scrollable').addClass('resume_scrollable'); } else { $('div #page').removeClass('resume_page'); $('div #scrollable').removeClass('resume_scrollable'); $('div #page').addClass('page_'); $('div #scrollable').addClass('scrollable_'); } } function tabs_(this_, id_, bool_fade){ $('#main_navi > li').removeClass('active'); if(bool_fade){ $('#wrapper').fadeOut(450, function(){ swapper(id_); }); } else { swapper(id_); } $(this_).addClass('active'); $('#wrapper').fadeIn(1000); } function url(arg){ arg = 'http://' + arg; window.location = arg; }