Fixes and Clouds animation
[snf-cloudcms] / cloudcms / static / cloudcms / js / common.js
index e336d01..b29d13f 100644 (file)
@@ -21,14 +21,11 @@ $(document).ready(function() {
        \r
     $('.show-extra').click(function(e) {\r
         e.preventDefault();\r
-        \r
-        $(this).parents('.bg-wrap').find('.extra').toggle('slow');\r
-        $('.hide-extra').toggle();    \r
+        $(this).parents('.bg-wrap').find('.extra').slideToggle(600);\r
     });\r
     $('.hide-extra').click(function(e) {\r
         e.preventDefault();\r
-        $(this).hide();\r
-        $(this).parents('.bg-wrap').find('.extra').hide('slow');\r
+        $(this).parents('.bg-wrap').find('.extra').slideUp(600);\r
     });\r
     \r
     $('.box-more p').click(function(e) {\r
@@ -48,6 +45,7 @@ $(document).ready(function() {
        }\r
        \r
        $('.top-msg a.close').click(function(e) {\r
+               e.preventDefault();\r
         $('.top-msg').animate({\r
             paddingTop:'0',\r
             paddingBottom:'0',\r
@@ -67,32 +65,91 @@ $(document).ready(function() {
     \r
     $('.top-msg .success').parents('.top-msg').css(\r
        {\r
-               backgroundColor: '#00A2B1',\r
+               backgroundColor: '#77C596',\r
                color: '#fff'\r
        }\r
-    )\r
+    );\r
     \r
     $('.top-msg .error').parents('.top-msg').css(\r
        {\r
-               backgroundColor: '#C43F73',\r
+               backgroundColor: '#EF4F54',\r
                color: '#fff'\r
        }\r
-    )\r
+    );\r
     \r
     \r
     $('.top-msg .warning').parents('.top-msg').css(\r
        {\r
-               backgroundColor: '#F0A216',\r
+               backgroundColor: '#F6921E',\r
                color: '#fff'\r
        }\r
-    )\r
+    );\r
     \r
     $('.top-msg .info').parents('.top-msg').css(\r
        {\r
-               backgroundColor: '#75A23A',\r
+               backgroundColor: '#C3C3B9',\r
                color: '#fff'\r
        }\r
-    )\r
+    );\r
+    \r
+    // clouds homepage animation\r
+    $('#animation a').hover(\r
+      function () {\r
+       \r
+        $(this).animate({\r
+           top: '+=-10'   \r
+           }, 600, function() {\r
+               if ($(this).find('img').attr('src').indexOf("_top") == -1) {\r
+                       var src = $(this).find('img').attr('src').replace('.png', '_top.png')\r
+                       $(this).find('img').attr("src", src);\r
+               }\r
+\r
+               });\r
+        $(this).siblings('p').find('img').animate({\r
+          width: '60%'       \r
+        });\r
+      }, \r
+      function () {\r
+\r
+        $(this).animate({top: '0'}, 600, function() {\r
+               var src = $(this).find('img').attr('src').replace('_top.png', '.png')\r
+                       $(this).find('img').attr("src", src);\r
+               });\r
+        $(this).siblings('p').find('img').animate({\r
+          width: '65%'       \r
+        });\r
+      }\r
+    );\r
+    \r
+    \r
+    /*$('#animation a').hover(\r
+      function () {\r
+       var src = $(this).find('img').attr('src').replace('.png', '_top.png')\r
+        $(this).find('img').attr("src", src);\r
+        $(this).animate({\r
+           top: '+=-10'   \r
+           }, 600, function() {\r
+                       // action to do when animation is finished\r
+               });\r
+        $(this).siblings('p').find('img').animate({\r
+          width: '60%'       \r
+        });\r
+      }, \r
+      function () {\r
+       \r
+        $(this).animate({\r
+         top: '0'   \r
+            \r
+        }, 600, function() {\r
+               var src = $(this).find('img').attr('src').replace('_top.png', '.png')\r
+               $(this).find('img').attr("src", src);\r
+               });\r
+        $(this).siblings('p').find('img').animate({\r
+          width: '65%'       \r
+        });\r
+      }\r
+    );*/\r
+    \r
     \r
 });\r
 \r