/estilos/js/custom.js

https://bitbucket.org/geekytheory/smallbirds · JavaScript · 120 lines · 85 code · 19 blank · 16 comment · 3 complexity · b287a4392165d4eb1aee11c9aa350394 MD5 · raw file

  1. $(document).ready(function(){
  2. //// slider settings ////
  3. $('#slider').nivoSlider({
  4. directionNavHide: false, // Only show on hover
  5. controlNav: false, // 1,2,3... navigation
  6. });
  7. //// End slider settings ////
  8. //// Start twitter settings ////
  9. jQuery(function($){
  10. $("#twitterbody").tweet({
  11. join_text: "auto",
  12. username: "UBLDesigns",
  13. avatar_size: 48,
  14. count: 3,
  15. auto_join_text_default: "we said,",
  16. auto_join_text_ed: "we",
  17. auto_join_text_ing: "we were",
  18. auto_join_text_reply: "we replied",
  19. auto_join_text_url: "we were checking out",
  20. loading_text: "loading tweets..."
  21. });
  22. });
  23. //// End twitter settings ////
  24. //// navigation motions ////
  25. $("#navi li").has("ul").hover(function(){
  26. $(this).addClass("current").children("ul").fadeIn('3000');
  27. }, function() {
  28. $(this).removeClass("current").children("ul").stop(true, true).fadeOut('3000');
  29. });
  30. $("<select />").appendTo("#navi");
  31. $("<option />", {
  32. "selected": "selected",
  33. "value" : "",
  34. "text" : "Navigation Menu"
  35. }).appendTo("#navi select");
  36. $("#navi ul li a").each(function() {
  37. var el = $(this);
  38. $("<option />", {
  39. "value" : el.attr("href"),
  40. "text" : el.text()
  41. }).appendTo("#navi select");
  42. });
  43. $("#navi select").change(function() {
  44. window.location = $(this).find("option:selected").val();
  45. });
  46. //// End navigation motions ////
  47. //// grey scaling function ////
  48. $(".bti").fadeTo(500, 0.4).hover(function () {
  49. $(this).fadeTo(500, 1);
  50. }, function () {
  51. $(this).fadeTo(500, 0.4);
  52. });
  53. $(".latestthree").hover(function () {
  54. $(this).find(".title").fadeTo(500, 0.4);
  55. $(this).find(".latestthreeimage").fadeTo(500, 0.4);
  56. }, function () {
  57. $(this).find(".title").fadeTo(500, 1);
  58. $(this).find(".latestthreeimage").fadeTo(500, 1);
  59. });
  60. //// End grey scaling function ////
  61. //// Start Scroll Top Function ////
  62. $(window).bind('scroll', function(){
  63. if($(this).scrollTop() > 200) {
  64. $("#scrolltab").fadeIn('3000');
  65. }
  66. if($(this).scrollTop() < 199){
  67. $("#scrolltab").fadeOut('3000');
  68. }
  69. });
  70. $('#scrolltab').live('click', function(){
  71. $("html, body").animate({scrollTop:0}, 'slow');
  72. });
  73. //// End Scroll Top Function ////
  74. //// Start Tabs Function ////
  75. $('.tab').click(function () {
  76. $('.tabs_container > .tabs > li.active').removeClass('active');
  77. $(this).parent().slideDown('slow').addClass('active');
  78. $('.tabs_container > .tab_contents_container > div.tab_contents_active').slideUp('slow').removeClass('tab_contents_active');
  79. $(this.rel).slideDown('slow').addClass('tab_contents_active');
  80. });
  81. //// End Tabs Function ////
  82. //// Start Toggle Function ////
  83. $(".togglewrap .togglecontent").hide();
  84. $('.togglewrap .toggletitle.active').addClass('active').next().show();
  85. $(".togglewrap .toggletitle").click(function(){
  86. $(this).toggleClass("active").next().slideToggle("fast");
  87. return false;
  88. });
  89. //// End Toggle Function ////
  90. //// Start Accordian Function ////
  91. $('.accordionwrap .accordioncontent').hide();
  92. $('.accordionwrap .accordiontitle:first-child').addClass('active').next().show();
  93. $('.accordionwrap .accordiontitle').click(function() {
  94. if($(this).next().is(':hidden')) {
  95. $(this).parent().find(".accordiontitle").removeClass('active').next().slideUp('fast');
  96. $(this).toggleClass('active').next().slideDown('fast');
  97. }
  98. return false;
  99. });
  100. //// End Accordian Function ////
  101. });