From 1b06243dabb7d88a2a89c0f37bd6fa69272a5bfa Mon Sep 17 00:00:00 2001 From: substantialnoninfringinguser Date: Wed, 13 May 2009 06:22:07 +0100 Subject: [svn] Improve registration system. Add jquery fade effects and quick search. Copied from http://cucc@cucc.survex.com/svn/trunk/expoweb/troggle/, rev. 8334 by cucc @ 5/10/2009 5:23 AM --- media/js/base.js | 114 ++++++++++++++++++++++++++++++++++--------------------- 1 file changed, 71 insertions(+), 43 deletions(-) (limited to 'media/js/base.js') diff --git a/media/js/base.js b/media/js/base.js index 17a664e..0dc562b 100644 --- a/media/js/base.js +++ b/media/js/base.js @@ -1,46 +1,74 @@ - function showDiv(collapsed,expanded){ - document.getElementById(collapsed).style.display = 'none'; - document.getElementById(expanded).style.display = 'block'; - } - - function hideDiv(collapsed,expanded){ - document.getElementById(collapsed).style.display = 'block'; - document.getElementById(expanded).style.display = 'none'; - } - - function makeDivTransparent(div){ - document.getElementById(div).style.backgroundColor = 'transparent'; - } - - - -hex=0 // Initial color value. -leftPos=25 -year=1976 -currentDate= new Date() -currentYear = currentDate.getFullYear() -function fadeText(){ -if(hex<153) { //If color is not black yet - hex=hex+10; // increase color darkness - leftPos-=1; - document.getElementById("expoHeader").style.color="rgb("+0+","+hex+","+0+")"; -// document.getElementById("expoFinalDate").style.color="rgb("+0+","+hex+","+0+")"; - document.getElementById("expoHeader").style.left=leftPos; - setTimeout("fadeText()",50) - setTimeout("countUpYear()",1000) -} -else { - hex=0; - leftPos=25; -} +$(document).ready(function() { + +$('.searchable li').quicksearch({ + position: 'before', + attached: 'ul.searchable', + labelText: '', + loaderText: '', + delay: 100 +}) + +$('table.searchable tr').quicksearch({ + position: 'before', + attached: 'table.searchable:first', +}); + +$(".toggleEyeCandy").click(function () { + $(".leftMargin,.rightMargin").toggle("fade"); + $(".toggleEyeCandy").toggle(); + }); + +$(".nav").css('opacity','7') +$(".footer").hide(); +$(".fadeIn").hide(); +setTimeout("$('.leftMargin.fadeIn').fadeIn(3000);",1000); +setTimeout("$('.rightMargin.fadeIn').fadeIn(3000);",2000); + + +/*$("#footerLinks").hover( + function() {$(".footer").fadeIn("slow")}, + function() {$(".footer").fadeOut("slow")} +);*/ + +function linkHover(hoverLink,image){ + +$(hoverLink).hover( + function() { + $(image).fadeIn("slow"); + $(hoverLink).css("background","gray"); + }, + function() { + $(image).fadeOut("slow"); + $(hoverLink).css("background","black"); + } +); + + + +}; + +linkHover("#expoWebsiteLink","#richardBanner"); +linkHover("#cuccLink","#timeMachine"); +linkHover("#surveyBinderLink","#surveyHover"); +linkHover("#troggle","#timeMachine"); + + +}); + +function contentHeight(){ +setMaxHeight($(".rightMargin,#content,.leftMargin,#col2"),$("#content")); +}; + +function setMaxHeight(group, target) { + tallest = 0; + group.each(function() { + thisHeight = $(this).height(); + if(thisHeight > tallest) { + tallest = thisHeight; + } + }); + target.height(tallest); } -function countUpYear(){ - if (year" - setTimeout("countUpYear()",1000) - } -} \ No newline at end of file + -- cgit v1.2.3