Advertisement
towfiqi

asteria.js

Dec 14th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 13.09 KB | None | 0 0
  1. // JavaScript Document
  2. jQuery(window).ready(function() {
  3.  
  4. //Text Animation Color
  5. jQuery('.single_metainfo .catag_list a, .auth_meta, .meta_comm a, .post_meta a').hover(function(){
  6. jQuery(this).stop().animate({"opacity": "1", "color":sechover }, 200);
  7. }, function(){
  8. jQuery(this).stop().animate({ "color":primarytext }, 200);
  9. });
  10. //Single Social buttons Animation
  11. jQuery('.social_buttons div a').hover(function(){
  12. jQuery(this).find('i').stop().animate({ "color":primarycolor }, 200);
  13. }, function(){
  14. jQuery(this).find('i').stop().animate({ "color":socialbuttons }, 200);
  15. });
  16. //Sidebar item hover animation
  17. jQuery('#sidebar .widgets .widget li').hover(function(){
  18. jQuery(this).find('a, i').animate({ "color":sechover }, 200);
  19. }, function(){
  20. jQuery(this).find('a, i').animate({ "color":primarytext }, 200);
  21. });
  22. //Block Animation
  23. if (jQuery(window).width() > 480) {
  24. jQuery('.midrow_block').hover(function(){
  25. jQuery(this).stop().animate({ "color":sechovertext, "backgroundColor":sechover, "paddingTop":"0px" }, 200);
  26. jQuery(this).find('.icon_wrap i').animate({ "color":sechovertext }, 200);
  27. jQuery(this).find('.midrow_block:hover .block_img').animate({ "borderColor":sechovertext }, 200);
  28. }, function(){
  29. jQuery(this).stop().animate({ "color":primarytext, "backgroundColor":"transparent", "paddingTop":"2%" }, 200);
  30. jQuery(this).find('.icon_wrap i').animate({ "color":"rgba(0, 0, 0, 0.15)" }, 200);
  31. jQuery(this).find('.midrow_block:hover .block_img').animate({ "borderColor":"rgba(0, 0, 0, 0.15)" }, 200);
  32. });
  33. }
  34. //Related Animation
  35. jQuery('.nav-box').hover(function(){
  36. jQuery(this).stop().animate({ "color":sechovertext, "backgroundColor":primarycolor }, 200);
  37. }, function(){
  38. jQuery(this).stop().animate({ "color":primarytext, "backgroundColor":primardefault }, 200);
  39. });
  40. //Sidebar & Home Widget Hover Animation
  41. jQuery('#home_widgets .widget li a, #sidebar .widget li a').hover(function(){
  42. jQuery(this).stop().animate({ "color":sechover}, 200);
  43. }, function(){
  44. jQuery(this).stop().animate({ "color":sidebarcolor}, 200);
  45. });
  46. //Footer Widget color Animation
  47. jQuery('#footer .widgets .widget ul li a').hover(function(){
  48. jQuery(this).stop().animate({ "color":footwidgethover}, 200);
  49. }, function(){
  50. jQuery(this).stop().animate({ "color":footwidget}, 200);
  51. });
  52. //Footer Menu Animation
  53. jQuery('#footmenu ul li a').hover(function(){
  54. jQuery(this).stop().animate({ "color":sechover}, 200);
  55. }, function(){
  56. jQuery(this).stop().animate({ "color":primarytext}, 200);
  57. });
  58. //MENU Animation
  59. if (jQuery(window).width() > 768) {
  60. jQuery('#topmenu ul > li').hoverIntent(function(){
  61. jQuery(this).find('.sub-menu:first, ul.children:first').slideDown({ duration: 200});
  62. jQuery(this).find('a').not('.sub-menu a').stop().animate({"color":primarycolor}, 200);
  63. }, function(){
  64. jQuery(this).find('.sub-menu:first, ul.children:first').slideUp({ duration: 200});
  65. jQuery(this).find('a').not('.sub-menu a').stop().animate({"color":menutext}, 200);
  66.  
  67. });
  68.  
  69. jQuery('#topmenu ul li').not('#topmenu ul li ul li').hover(function(){
  70. jQuery(this).addClass('menu_hover');
  71. }, function(){
  72. jQuery(this).removeClass('menu_hover');
  73. });
  74. jQuery('#topmenu li').has("ul").addClass('zn_parent_menu');
  75. jQuery('.zn_parent_menu > a').append('<span><i class="fa-angle-down"></i></span>');
  76. }
  77.  
  78. //Slider Navigation Animation
  79. jQuery('#zn_nivo').hover(function(){
  80. jQuery(this).find('.nivo-directionNav').stop().animate({ "opacity":"1" }, 300);
  81. }, function(){
  82. jQuery(this).find('.nivo-directionNav').stop().animate({ "opacity":"0" }, 300);
  83. });
  84.  
  85. //Slider empty content
  86. jQuery('.acord_text p:empty, .acord_text h3 a:empty, .uninner h3 a:empty, .nivoinner h3 a:empty').css({"display":"none"});
  87.  
  88. //Widget image opacity animation
  89. jQuery('.widget_wrap a img').hover(function(){
  90. jQuery(this).stop().animate({ "opacity":"0.7" }, 300);
  91. }, function(){
  92. jQuery(this).stop().animate({ "opacity":"1" }, 300);
  93. });
  94.  
  95.  
  96. //Layout1 Animation
  97. if (jQuery(window).width() < 360) {
  98. var divs = jQuery(".lay1 .hentry");
  99. for(var i = 0; i < divs.length; i+=1) {
  100. divs.slice(i, i+1).wrapAll("<div class='ast_row'></div>");
  101. }
  102. }else if (jQuery(window).width() < 480) {
  103. var divs = jQuery(".lay1 .hentry");
  104. for(var i = 0; i < divs.length; i+=2) {
  105. divs.slice(i, i+2).wrapAll("<div class='ast_row'></div>");
  106. }
  107. }else{
  108. var divs = jQuery(".lay1 .hentry");
  109. for(var i = 0; i < divs.length; i+=3) {
  110. divs.slice(i, i+3).wrapAll("<div class='ast_row'></div>");
  111. }
  112. }
  113.  
  114. jQuery('.lay1 .postitle a:empty').closest("h2").addClass('no_title');
  115. jQuery('.no_title').css({"padding":"0"});
  116.  
  117.  
  118. //Pagination
  119. if ( jQuery('.ast_pagenav').children().length < 7 ) {
  120. jQuery('.ast_pagenav .page-numbers:last-child').css({'marginRight':'0'});
  121. jQuery('.ast_pagenav .page-numbers').wrapAll('<div class="pagi_border" />');
  122. jQuery('.pagi_border').append('<dt />');
  123. var sum=0;
  124. jQuery('.ast_pagenav .page-numbers').each( function(){ sum += jQuery(this).outerWidth( true ); });
  125. jQuery('.ast_pagenav .pagi_border').width( sum );
  126. }
  127.  
  128. //Call to Action
  129. jQuery('.home_action_left').each(function (){
  130. var callheight = jQuery(this) .height();
  131. jQuery('.home_action_right') .css({'height': callheight});
  132. });
  133.  
  134.  
  135. //Related Tabs
  136. if (jQuery('#ast_related:has(*)').length) {
  137. jQuery('#ast_related').easytabs({transitionIn: 'fadeIn', transitionOut: 'fadeOut', transitionInEasing : 'linear'});
  138. }else{
  139. jQuery('#ast_related_wrap').remove();
  140. }
  141.  
  142.  
  143. // TO_TOP
  144. jQuery(window).bind("scroll", function() {
  145. if (jQuery(this).scrollTop() > 800) {
  146. jQuery(".to_top").fadeIn('slow');
  147. } else {
  148. jQuery(".to_top").fadeOut('fast');
  149. }
  150. });
  151. jQuery(".to_top").click(function() {
  152. jQuery("html, body").animate({ scrollTop: 0 }, "slow");
  153. return false;
  154. });
  155.  
  156.  
  157. //Sidebar widget padding fix
  158. jQuery('.widget').not(':has(.widgettitle)').addClass('untitled');
  159. jQuery('.rel_eq').equalHeights();
  160.  
  161. //Hide Homepage Elemnts if empty
  162. jQuery('.home_blocks').each(function () {
  163. if(jQuery(this).html().length > 3) {
  164. jQuery(this).addClass('activeblock');
  165. }
  166. });
  167.  
  168.  
  169. jQuery('.lay1, .lay2, .lay3, .lay4, .lay5, .lay6').not(':has(.hentry)').css({"display":"none"});
  170.  
  171.  
  172. //WAYPOINT ANIMATIONS
  173. if (jQuery(window).width() > 480) {
  174. jQuery('.home_tabs .center, .midrow_block, .home .lay4').css({"opacity":"0", "marginTop":"60px"});
  175.  
  176. jQuery('.midrow_block').css({"marginTop":"60px"})
  177. jQuery('.midrow_blocks').waypoint(function() {
  178. jQuery('.midrow_block:eq(0)').animate({"opacity":"1", "marginTop":"0px"});
  179. jQuery('.midrow_block:eq(1)').delay(150).animate({"opacity":"1", "marginTop":"0px"});
  180. jQuery('.midrow_block:eq(2)').delay(300).animate({"opacity":"1", "marginTop":"0px"});
  181. jQuery('.midrow_block:eq(3)').delay(450).animate({"opacity":"1", "marginTop":"0px"});
  182.  
  183. }, { offset: '80%' });
  184.  
  185. //Posts Animation
  186. jQuery('.home .lay1 .hentry:eq(0) , .home .lay1 .hentry:eq(1) , .home .lay1 .hentry:eq(2), .homeposts_title').css({"opacity":"0","marginTop":"60px"})
  187. jQuery('.home .lay1').waypoint(function() {
  188. jQuery('.home .homeposts_title').animate({"opacity":"1", "marginTop":"0px"});
  189. jQuery('.home .lay1 .hentry:eq(0)').delay(150).animate({"opacity":"1", "marginTop":"0px"});
  190. jQuery('.home .lay1 .hentry:eq(1)').delay(300).animate({"opacity":"1", "marginTop":"0px"});
  191. jQuery('.home .lay1 .hentry:eq(2)').delay(450).animate({"opacity":"1", "marginTop":"0px"});
  192. }, { offset: '90%' });
  193.  
  194. //Call to Action
  195. jQuery('.home_action').css({"opacity":"0"})
  196. jQuery('.home_action').waypoint(function() {
  197. jQuery(this).animate({"opacity":"1"});}, { offset: '90%' });
  198.  
  199. //Home Widgets Animation
  200. jQuery('#home_widgets .widget:eq(0) , #home_widgets .widget:eq(1) , #home_widgets .widget:eq(2)').css({"opacity":"0","marginTop":"60px"})
  201. jQuery('#home_widgets').waypoint(function() {
  202. jQuery('#home_widgets .widget:eq(0)').animate({"opacity":"1", "marginTop":"0px"});
  203. jQuery('#home_widgets .widget:eq(1)').delay(150).animate({"opacity":"1", "marginTop":"0px"});
  204. jQuery('#home_widgets .widget:eq(2)').delay(300).animate({"opacity":"1", "marginTop":"0px"});
  205.  
  206. }, { offset: '90%' });
  207.  
  208. jQuery('.home_tabs .center, .lay4').waypoint(function() {
  209. jQuery(this).animate({"opacity":"1", "marginTop":"0px"});
  210. }, { offset: '90%' });
  211. }
  212.  
  213. //Layout6 Animation
  214. jQuery('.lay6 .hentry .imgwrap').hoverIntent(function(){
  215. jQuery(this).find('.postitle').fadeOut(200);
  216. jQuery(this).find('.postitle').delay(50).css({"display":"none","width":"92%", "height":"80%", "paddingTop":"20%", "textAlign":"center", "background":"rgba(0, 0, 0, 0.4)", "bottom":"-10px"});
  217. jQuery(this).find('.postitle').fadeIn(200);
  218. jQuery(this).find('.postitle a').append('<div class="icon_wrap"><div class="icon_round"><a href="http://localhost/wptrt/?p=128"><i class="fa-link fa-2x"></i></a></div></div>')
  219. }, function(){
  220. jQuery(this).find('.postitle').css({"display":"none","width":"auto%", "height":"auto", "paddingTop":"0", "textAlign":"left", "background":"none", "bottom":"0px"});
  221. jQuery(this).find('.postitle').delay(10).fadeIn(400);
  222. jQuery(this).find(".icon_wrap").remove();
  223. });
  224.  
  225. //Next Previous post button Link
  226. var link = jQuery('.ast-next > a').attr('href');
  227. jQuery('.right_arro').attr('href', link);
  228.  
  229. var link = jQuery('.ast-prev > a').attr('href');
  230. jQuery('.left_arro').attr('href', link);
  231.  
  232. //Gallery Template
  233. jQuery("#sidebar .widget_pages ul li a, #sidebar .widget_meta ul li a, #sidebar .widget_nav_menu ul li a, #sidebar .widget_categories ul li a, #sidebar .widget_recent_entries ul li a, #sidebar .widget_recent_comments ul li, #sidebar .widget_archive ul li, #sidebar .widget_rss ul li").prepend('<i class="fa-double-angle-right"></i> ')
  234. jQuery('#sidebar .fa-double-angle-right').css({"opacity":"0.5"})
  235.  
  236. //Columns Shortcode Clear
  237. jQuery('.col2:eq(1), .col2:eq(3), .col2:eq(5), .col2:eq(7), .col2:eq(9), .col2:eq(11), .col2:eq(13), .col2:eq(15)').after('<div style="clear:both" />');
  238. jQuery('.col3:eq(2), .col3:eq(5), .col3:eq(8), .col3:eq(11), .col3:eq(14), .col3:eq(17), .col3:eq(20), .col3:eq(23)').after('<div style="clear:both" />');
  239. jQuery('.col4:eq(3), .col4:eq(7), .col4:eq(11), .col4:eq(15), .col3:eq(19), .col4:eq(23), .col4:eq(27), .col4:eq(31)').after('<div style="clear:both" />');
  240.  
  241. //Responsive Video Shortcode
  242.  
  243. jQuery('.vid_iframe').each(function () {
  244. var vidheights = jQuery(this).height();
  245. jQuery(this).closest('.ast_vid').css({ 'height':vidheights});
  246.  
  247. });
  248.  
  249. //Shortcode JS
  250. //Tabs Javascript
  251. jQuery(".lgn_tab p:empty").remove();
  252. var i = 1;
  253. jQuery(".tabs-container .tabli a").each(function (){jQuery(this).attr('href', '#tab-'+i+''); i++;});
  254.  
  255. var i = 1;
  256. jQuery(".lgn_tab div").each(function (){jQuery(this).attr('id', 'tab-'+i+''); i++;});
  257.  
  258. var i = 1;
  259. jQuery(".tabs-container").each(function (){jQuery(this).attr('id', 'tabs-container_'+i+''); i++;});
  260.  
  261. jQuery('#tabs-container_1, #tabs-container_2, #tabs-container_3, #tabs-container_4, #tabs-container_5, #tabs-container_5').easytabs();
  262.  
  263. //Toggle Shortcode
  264. jQuery('.lgn_toggle_content').hide(); // Hide even though it's already hidden
  265. jQuery('.trigger').click(function() {
  266. jQuery(this).closest('.lgn_toggle').find('.lgn_toggle_content').slideToggle("fast"); // First click should toggle to 'show'
  267. return false;
  268. });
  269. jQuery('.lgn_toggle a').toggle(function(){
  270. jQuery(this).addClass('down');
  271. }, function(){
  272. jQuery(this).removeClass('down');
  273. });
  274.  
  275. //Mobile Menu
  276.  
  277. //jQuery("#topmenu").attr("id","sidr");
  278. var padmenu = jQuery("#simple-menu").html();
  279. jQuery('#simple-menu').sidr({
  280. name: 'sidr-main',
  281. source: '#topmenu'
  282. });
  283. jQuery(".sidr").prepend("<div class='pad_menutitle'>"+padmenu+"<span><i class='fa-times'></i></span></div>");
  284.  
  285. jQuery(".pad_menutitle span").click(function() {
  286. jQuery.sidr('close', 'sidr-main')
  287. preventDefaultEvents: false;
  288.  
  289. });
  290.  
  291.  
  292. //NivoSlider Navigation Bug Fix
  293. if (jQuery(window).width() < 480) {
  294. jQuery(".nivo-control").text('');
  295. }
  296.  
  297. //slider porgressbar loader
  298. jQuery(function () {
  299. var n = 0,
  300. $imgs = jQuery('.slider-wrapper img'),
  301. val = 100 / $imgs.length,
  302. $bar = jQuery('#astbar');
  303. $progrssn = jQuery('.progrssn');
  304.  
  305. $imgs.load(function () {
  306. n = n + val;
  307. // for displaying purposes
  308. $progrssn.width(n + '%');
  309. var numTruncated = parseFloat(n).toFixed(1);
  310. $bar.text(numTruncated);
  311. });
  312.  
  313. });
  314. jQuery('.slider-wrapper').waitForImages(function() {
  315. jQuery("#zn_nivo, .nivo-controlNav, #slide_acord, .nivoinner").fadeIn('slow');
  316. jQuery(".pbar_wrap").fadeOut();
  317. });
  318. jQuery(window).load(function(){
  319. jQuery('.nivo-controlNav').css({"display":"block"});
  320. });
  321. //load yanone font by default
  322. if (jQuery('#redux-google-fonts-css').length){}else{
  323. jQuery("h2, .mid_block_content h3, .widgettitle, .postitle, body .fixed_site .header4 #topmenu ul li a, .text_block, .lay1_title h3, #sidebar .widget .widgettitle, .left_arro, .right_arro, #submit, .widget_calendar caption, .rel_content a, #ast_related ul li a, .fourofour a").attr('style', 'font-family: "kaffeesatzthin"!important');
  324. }
  325.  
  326. //Remove margin from homeblocks after ast_blocks
  327. jQuery(".ast_blocks").next('.home_blocks').css({"marginTop":"0"});
  328. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement