Permalink
Browse files

initial import

  • Loading branch information...
0 parents commit c21f3bdd95884d8b8c4fa130785d2e79e1e96161 @1Marc committed Mar 24, 2009
@@ -0,0 +1,35 @@
+/* Fisheye Menu Styles */
+#fisheye_menu {
+ list-style: none;
+ padding: 0;
+ margin: 10px;
+ height: 81px;
+}
+#fisheye_menu li {
+ position: relative;
+ display: block;
+ float: left;
+ margin: 0;
+ padding: 0;
+}
+#fisheye_menu span {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ text-align: center;
+ width: 79px;
+ padding: 1px;
+ margin: 0;
+ border: solid 1px #bbb;
+ color: #333;
+ background: #eee;
+}
+#fisheye_menu a {
+ text-decoration: none;
+ margin: 0;
+ padding: 0;
+}
+#fisheye_menu img {
+ border: 0;
+ vertical-align: top;
+}
@@ -0,0 +1,88 @@
+/*!
+ * Fisheye Menu
+ * Copyright 2007-2009 Marc Grabanski (m@marcgrabanski.com) http://marcgrabanski.com
+ * Project Page: http://marcgrabanski.com/pages/code/fisheye-menu
+ * Under the MIT License */
+
+var fisheyemenu = {
+ startSize : 55,
+ endSize : 88,
+ imgType : ".gif",
+ init : function () {
+ var animElements = document.getElementById("fisheye_menu").getElementsByTagName("img");
+ var titleElements = document.getElementById("fisheye_menu").getElementsByTagName("span");
+ for(var j=0; j<titleElements.length; j++) {
+ titleElements[j].style.display = 'none';
+ }
+ for(var i=0; i<animElements.length; i++) {
+ var y = animElements[i];
+ y.style.width = fisheyemenu.startSize+'px';
+ y.style.height = fisheyemenu.startSize+'px';
+ fisheyemenu.imgSmall(y);
+ animElements[i].onmouseover = changeSize;
+ animElements[i].onmouseout = restoreSize;
+ }
+ function changeSize() {
+ fisheyemenu.imgLarge(this);
+ var x = this.parentNode.getElementsByTagName("span");
+ x[0].style.display = 'block';
+ if (!this.currentWidth) this.currentWidth = fisheyemenu.startSize;
+ fisheyemenu.resizeAnimation(this,this.currentWidth,fisheyemenu.endSize,15,10,0.333);
+ }
+ function restoreSize() {
+ var x = this.parentNode.getElementsByTagName("span");
+ x[0].style.display = 'none';
+ if (!this.currentWidth) return;
+ fisheyemenu.resizeAnimation(this,this.currentWidth,fisheyemenu.startSize,15,10,0.5);
+ fisheyemenu.imgSmall(this);
+ }
+ },
+ resizeAnimation : function (elem,startWidth,endWidth,steps,intervals,powr) {
+ if (elem.widthChangeMemInt) window.clearInterval(elem.widthChangeMemInt);
+ var actStep = 0;
+ elem.widthChangeMemInt = window.setInterval(
+ function() {
+ elem.currentWidth = fisheyemenu.easeInOut(startWidth,endWidth,steps,actStep,powr);
+ elem.style.width = elem.currentWidth+"px";
+ elem.style.height = elem.currentWidth+"px";
+ actStep++;
+ if (actStep > steps) window.clearInterval(elem.widthChangeMemInt);
+ }
+ ,intervals)
+ },
+ easeInOut : function (minValue,maxValue,totalSteps,actualStep,powr) {
+ //Generic Animation Step Value Generator By www.hesido.com
+ var delta = maxValue - minValue;
+ var stepp = minValue+(Math.pow(((1 / totalSteps)*actualStep),powr)*delta);
+ return Math.ceil(stepp)
+ },
+ imgSmall : function (obj) {
+ imgSrc = obj.getAttribute("src");
+ var typePos = imgSrc.indexOf(fisheyemenu.imgType, 0);
+ var imgName = imgSrc.substr(0, typePos);
+ obj.setAttribute("src", imgName+"_small"+fisheyemenu.imgType);
+ },
+ imgLarge : function (obj) {
+ imgSrc = obj.getAttribute("src");
+ var typePos = imgSrc.indexOf("_small", 0);
+ var imgName = imgSrc.substr(0, typePos);
+ obj.setAttribute("src", imgName+fisheyemenu.imgType);
+ }
+}
+
+// Add event with wide browser support
+if ( typeof window.addEventListener != "undefined" )
+ window.addEventListener( "load", fisheyemenu.init, false );
+else if ( typeof window.attachEvent != "undefined" )
+ window.attachEvent( "onload", fisheyemenu.init );
+else {
+ if ( window.onload != null ) {
+ var oldOnload = window.onload;
+ window.onload = function ( e ) {
+ oldOnload( e );
+ fisheyemenu.init();
+ };
+ }
+ else
+ window.onload = fisheyemenu.init;
+}
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@@ -0,0 +1,44 @@
+/* CSS Document */
+body {
+ padding: 0;
+ margin: 0;
+ background: #eee;
+}
+#wrap {
+ margin: 0 auto;
+ width: 500px;
+ padding: 10px;
+ border: 1px solid #bbb;
+ text-align: center;
+ background: #EEEEE1;
+}
+#fisheye_menu {
+ list-style: none;
+ padding: 0;
+ margin: 10px;
+ height: 81px;
+}
+#fisheye_menu li {
+ position: relative;
+ display: block;
+ float: left;
+}
+#fisheye_menu span {
+ position: absolute;
+ top: 100%;
+ left: 0;
+ text-align: center;
+ width: 79px;
+ padding: 1px;
+ margin: 0;
+ border: solid 1px #bbb;
+ color: #333;
+ background: #eee;
+}
+#fisheye_menu a {
+ text-decoration: none;
+}
+#fisheye_menu img {
+ border: 0;
+ vertical-align: top;
+}

0 comments on commit c21f3bd

Please sign in to comment.