Advertisement
Guest User

Untitled

a guest
Jun 19th, 2014
297
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.81 KB | None | 0 0
  1. /*Multilevel dropdown menu
  2. / ====================================================================================
  3. */
  4. $(document).ready(function(){
  5. $("ul.simple-drop-down-menu li").each(function () {
  6. $(this).hoverIntent({
  7. timeout: 300,
  8. over: function () {
  9. var current = $("ul:first", this);
  10. current.fadeIn(300);
  11.  
  12. },
  13. out: function () {
  14. var current = $("ul:first", this);
  15. current.fadeOut(300);
  16. }
  17. });
  18. });
  19. $("ul.simple-drop-down-menu li:has(ul)").find("a:first").append("<span></span>");
  20. $("ul.simple-drop-down-menu li:has(ul) a").addClass("parent");
  21.  
  22. });
  23.  
  24. /*Get first Word in heading tag & Peload image in css
  25. / ====================================================================================
  26. */
  27. $(document).ready(function(){
  28. /*Preload image in Css file*/
  29. $.preloadCssImages();
  30.  
  31. /*Get first word*/
  32. $(".first-word").each(function(){
  33. var me = $(this);
  34. me.html(me.html().replace(/^([\w-]+)/, "<strong>$1</strong>"));
  35. });
  36.  
  37.  
  38. });
  39.  
  40. /*Quicksand
  41. / ====================================================================================
  42. */
  43. $(document).ready(function(){
  44. /* Clone applications to get a second collection */
  45. $(".portfolio-content.three-column > div.block").addClass("project");
  46. /*Add data-id attribute automatically*/
  47.  
  48. var $data = $(".portfolio-content").clone();
  49. $('.portfolio-main li.all-projects').addClass("current");
  50. //NOTE: Only filter on the main portfolio page, not on the subcategory pages
  51. $('.portfolio-main li').click(function(e) {
  52. $(".filter li").removeClass("current");
  53.  
  54.  
  55. /*Use the last category class as the category to filter by. This means that multiple categories are not supported (yet)*/
  56. var filterClass=$(this).attr('class').split(' ').slice(-1)[0];
  57.  
  58. if (filterClass == 'all-projects') {
  59. var $filteredData = $data.find('.project');
  60. } else {
  61. var $filteredData = $data.find('.project[data-type=' + filterClass + ']');
  62. }
  63. $(".portfolio-content").quicksand($filteredData, {
  64.  
  65. duration: 800,
  66. easing: 'swing',
  67. enhancement: function() {Cufon.refresh();$(".video-preview,.image-preview").mPreviewOverlay();$("*[rel^='prettyPhoto']").prettyPhoto();}
  68. });
  69. $(this).addClass("current");
  70. return false;
  71.  
  72. });
  73. });
  74.  
  75.  
  76. /*Blog entry View-Switcher with Cookie
  77. / ====================================================================================
  78. */
  79. $(document).ready(function(){
  80.  
  81. /*Switch view*/
  82. var cookieName = "active-view",
  83. cookieOptions = {expires: 7, path: "/"},
  84. blogEntry = $("#list-blog-entry li"),
  85. switcherLink = $("#view-switcher li a");
  86.  
  87. /*Check if a cookie with name of "active-view" exists.*/
  88. /*if not exists will add default blog entry view*/
  89.  
  90. switcherLink.css({opacity:.5});
  91. if( $.cookie("active-view") == null ) {
  92. $("#view-switcher li a.display-list").css({opacity:1}).parent().addClass("active");
  93. $("#list-blog-entry").addClass("display-list");
  94. blogEntry.equalHeights();
  95. }
  96. /*if exists , load cookie and use saved view status*/
  97. else{
  98. $("#view-switcher li a." + $.cookie(cookieName)).css({opacity:1}).parent("li").addClass("active");
  99. blogEntry.removeAttr("style");
  100. $("#list-blog-entry").removeClass().addClass("list-blog-entry").fadeIn().addClass($.cookie(cookieName));
  101. blogEntry.equalHeights();
  102. }
  103. /*event add cookie and switch display*/
  104. switcherLink.click(function(){
  105. blogEntry.removeAttr("style");
  106.  
  107. switcherLink.css({opacity:.5});
  108. $(this).css({opacity:1});
  109.  
  110. /*remove all class active from switcher tab*/
  111. $("#view-switcher li").removeClass("active");
  112. $.cookie(cookieName, $(this).attr("class"), cookieOptions);
  113. $("." + $.cookie(cookieName)).parent().addClass("active");
  114.  
  115.  
  116.  
  117.  
  118. /*Fade out current view and fade in with new view*/
  119. $("#list-blog-entry").fadeOut(function(){
  120. $(this).removeClass().addClass("list-blog-entry").fadeIn(function(){blogEntry.equalHeights();}).addClass($.cookie(cookieName));
  121.  
  122. });
  123.  
  124. /*alert($.cookie("active-view"));*/
  125. });
  126.  
  127. });
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134. $(document).ready(function(){
  135.  
  136.  
  137. /*Fake Smooth preloader
  138. / ====================================================================================
  139. /This must include after quicksand
  140. */
  141. if ( $.browser.webkit || $.browser.mozilla || $.browser.msie && $.browser.version > 8 ) {
  142. $("#body-content,#footer-content").maxxSmoothPreloader();
  143. };
  144.  
  145.  
  146.  
  147. /*Some Effect
  148. / ====================================================================================
  149. */
  150.  
  151. /*Pretty Photo*/
  152. $("*[rel^='prettyPhoto']").prettyPhoto();
  153.  
  154. /*preview Overlay*/
  155. $(".video-preview,.image-preview").mPreviewOverlay();
  156.  
  157. $(".back-to-top").click(function(){$("html,body").animate({scrollTop:0}, 800)});
  158. $(".social-network li a img").css({opacity:.5});
  159. $(".social-network li a").hover(function(){
  160. $("img",this).stop().animate({
  161. opacity:1,
  162. marginTop:'0px'
  163. },300);
  164. },function(){
  165. $("img",this).stop().animate({
  166. opacity:.5,
  167. marginTop:'5px'
  168. },300);
  169. });
  170.  
  171. /*Valid Form*/
  172. $("#contact-form").validate();
  173.  
  174. /*auto align layout
  175. / ====================================================================================
  176. */
  177.  
  178. $(".list-blog-entry li:odd").addClass("odd");
  179. $("#sidebar .ads a:even,.list-blog-entry li:even").addClass("even");
  180. $(".services.three-column").countThree({className:"last-child-of-line"});
  181. $("ul.zigzag li:last-child,ul.simple-drop-down-menu ul li:last-child").css({borderBottom:"none"});
  182. $(".three-column .block:last-child").addClass("last-child");
  183.  
  184. /*Tooltip
  185. / ====================================================================================
  186. */
  187. $(".tipMe").tipTip({maxWidth: "auto", edgeOffset: 5});
  188. $(".tipMe.tip_left").tipTip({maxWidth: "auto", edgeOffset: 5,defaultPosition:"left"});
  189. $(".tipMe.tip_right").tipTip({maxWidth: "auto", edgeOffset: 5,defaultPosition:"right"});
  190. $(".tipMe.tip_top").tipTip({maxWidth: "auto", edgeOffset: 5,defaultPosition:"top"});
  191.  
  192.  
  193.  
  194. /*Empty text-box
  195. / ====================================================================================
  196. */
  197. $("input:text,input:password").css({color:'#222'});
  198. $("input:text,input:password").emptyTextBox();
  199.  
  200. /*Scoll to comment
  201. / ====================================================================================
  202. */
  203. $(".add-comment").click(function(){
  204. var offsets = $("#add-comment-form").offset();
  205. $("html,body").animate({scrollTop:offsets.top - 80}, 800);
  206. return false;
  207. });
  208.  
  209. /*Nivo slider
  210. / ====================================================================================
  211. */
  212. $("#slider").nivoSlider();
  213. /*Slide button effect*/
  214. $(".nivo-directionNav a.nivo-nextNav").delay(1000).animate({right:390});
  215. $(".nivo-directionNav a.nivo-prevNav").delay(1000).animate({left:390});
  216. $(".nivo-directionNav").hoverIntent({
  217. timeout: 300,
  218. over: function () { $("a.nivo-nextNav").animate({right:355});$("a.nivo-prevNav").animate({left:355});},
  219. out: function () { $("a.nivo-nextNav").animate({right:390});$("a.nivo-prevNav").animate({left:390});}
  220. })
  221. /*Slide overlay .Remove the below line if you dont want the slice overlay*/
  222. $(".nivoSlider").find("a.nivo-imageLink").append("<div class='slide-overlay'></div>");
  223.  
  224.  
  225. /*Flick Gallery effect
  226. / ====================================================================================
  227. */
  228. $(".flick-gallery li a").mPreviewOverlay({opacityOverlay:.3});
  229. /*Reset marin*/
  230. $(".flick-gallery").countThree({className:"reset-margin-right"});
  231.  
  232.  
  233. /*Equal Heights
  234. / ====================================================================================
  235. */
  236. $("ul.display-short li").equalHeights();
  237. $(".services .block .content").equalHeights();
  238. $(".entry .block .content").equalHeights();
  239.  
  240. /*Flick Gallery2 effect
  241. / ====================================================================================
  242. */
  243. }};
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement