Advertisement
Guest User

prettyphoto3.0-moded

a guest
Nov 22nd, 2010
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. jQuery(function ($) {
  2. function mycarousel_initCallback(carousel) {
  3.     jQuery('.jcarousel-control a').bind('click', function() {
  4.         carousel.scroll(jQuery.jcarousel.intval(jQuery(this).text()));
  5.         return false;
  6.     });
  7.  
  8.     jQuery('.jcarousel-scroll select').bind('change', function() {
  9.         carousel.options.scroll = jQuery.jcarousel.intval(this.options[this.selectedIndex].value);
  10.         return false;
  11.     });
  12. // Next Button
  13. $('#mycarousel-next').bind('click',
  14. function() {
  15.     carousel.next();
  16.     return false;
  17. });
  18. // Prev Button
  19. $('#mycarousel-prev').bind('click',
  20. function() {
  21.     carousel.prev();
  22.     return false;
  23. });
  24. }
  25. function disableCustomButtons(carousel){
  26.    
  27.     var prev_class = 'jcarousel-prev-disabled jcarousel-prev-disabled-horizontal';
  28.     if (carousel.first == 1) {
  29.     $('#mycarousel-prev').attr('disabled', 'true').addClass(prev_class);
  30.     } else {
  31.     $('#mycarousel-prev').attr('disabled', 'false').removeClass(prev_class);
  32.     }
  33.  
  34.     var next_class = 'jcarousel-next-disabled jcarousel-next-disabled-horizontal';
  35.     if (carousel.last == carousel.size()) {
  36.     $('#mycarousel-next').attr('disabled', 'true').addClass(next_class);
  37.     } else {
  38.     $('#mycarousel-next').attr('disabled', 'false').removeClass(next_class);
  39.     }
  40. }
  41.     $(".mycarousel").jcarousel({
  42.         scroll: 1,
  43.     visible:4,
  44.         initCallback: mycarousel_initCallback,
  45.         // This tells jCarousel NOT to autobuild prev/next buttons
  46.         buttonNextHTML: null,
  47.         buttonPrevHTML: null,
  48.         //THIS IS THE PART YOU NEED-------------------
  49.         itemLastOutCallback: {
  50.            onAfterAnimation: disableCustomButtons
  51.         },
  52.         itemLastInCallback: {
  53.            onAfterAnimation: disableCustomButtons
  54.         }
  55.         //THIS IS THE PART YOU NEED-------------------
  56.     });
  57.   $(".photofade").hover(
  58.     function () {
  59.       $(this).fadeTo("fast", 0.20);
  60.     },
  61.     function () {
  62.       $(this).fadeTo("fast", 1);
  63.     }
  64.   );
  65. $("a.image_grid_thumb").toggle(function(){
  66.     $(this).addClass("swap");
  67.     $("ul.grid").fadeOut("fast", function() {
  68.     $(this).fadeIn("fast").addClass("list");
  69.          });
  70.       }, function () {
  71. $(this).removeClass("swap");
  72.     $("ul.grid").fadeOut("fast", function() {
  73.         $(this).fadeIn("fast").removeClass("list");
  74.         });
  75.     });
  76. $("a.image_grid_thumb").toggle(function(){
  77.     $("span#layout-list").fadeOut("fast", function() {
  78.     $(this).fadeIn("fast").addClass("active");
  79.     $("span#layout-gallery").removeClass("active");
  80.          });
  81.       }, function () {
  82.     $("span#layout-list").fadeOut("fast", function() {
  83.         $(this).fadeIn("fast").removeClass("active");
  84.     $("span#layout-gallery").addClass("active");
  85.         });
  86.     });
  87. $('div.cslider_box_enabled_display').toggleClass(function() {
  88.     if ($(this).parent().find('.cslider_box_enabled_check').is(':checked')) {
  89.     return 'showme';
  90.     } else {
  91.     return 'hideme';
  92.     }
  93.    
  94.  });
  95. $('div.cslider_box_enabled_check').click(function(){
  96.     $('div.cslider_box_enabled_display').removeClass('showme').toggleClass('hideme');
  97.     });
  98. $('div.cslider_panel_1_visible_display').toggleClass(function() {
  99.     if ($(this).parent().find('.cslider_panel_1_enabled').is(':checked')) {
  100.     return 'showme';
  101.     } else {
  102.     return 'hideme';
  103.     }
  104.    
  105.  });
  106. $('div.cslider_panel_1_enabled').click(function(){
  107.     $('div.cslider_panel_1_visible_display').removeClass('showme').toggleClass('hideme');
  108.     });
  109. $('div.cslider_panel_2_visible_display').toggleClass(function() {
  110.     if ($(this).parent().find('.cslider_panel_2_enabled').is(':checked')) {
  111.     return 'showme';
  112.     } else {
  113.     return 'hideme';
  114.     }
  115.    
  116.  });
  117. $('div.cslider_panel_2_enabled').click(function(){
  118.     $('div.cslider_panel_2_visible_display').removeClass('showme').toggleClass('hideme');
  119.     });
  120. $('div.cslider_panel_3_visible_display').toggleClass(function() {
  121.     if ($(this).parent().find('.cslider_panel_3_enabled').is(':checked')) {
  122.     return 'showme';
  123.     } else {
  124.     return 'hideme';
  125.     }
  126.    
  127.  });
  128. $('div.cslider_panel_3_enabled').click(function(){
  129.     $('div.cslider_panel_3_visible_display').removeClass('showme').toggleClass('hideme');
  130.     });
  131. $('div.cslider_panel_4_visible_display').toggleClass(function() {
  132.     if ($(this).parent().find('.cslider_panel_4_enabled').is(':checked')) {
  133.     return 'showme';
  134.     } else {
  135.     return 'hideme';
  136.     }
  137.    
  138.  });
  139. $('div.cslider_panel_4_enabled').click(function(){
  140.     $('div.cslider_panel_4_visible_display').removeClass('showme').toggleClass('hideme');
  141.     });
  142.  
  143. $(".setting-cslider_box_panel_1_display").click(function () {
  144.                 if ($(this).val() == "posts") {
  145.             $(".cslider_box_1_images").fadeOut(200, function () {
  146.             $(".cslider_box_1_video").fadeOut(200);
  147.             $(".cslider_box_1_custom").fadeOut(200);
  148.             $(".cslider_box_1_posts").fadeIn(200);
  149.             $(".cslider_box_1_3way").fadeIn(200);
  150.                     });
  151.                    
  152.                } else if ($(this).val() == "video") {
  153.             $(".cslider_box_1_posts").fadeOut(200, function () {
  154.             $(".cslider_box_1_images").fadeOut(200);
  155.             $(".cslider_box_1_custom").fadeOut(200);
  156.             $(".cslider_box_1_3way").fadeOut(200);
  157.             $(".cslider_box_1_video").fadeIn(200);
  158.                     });
  159.                } else if ($(this).val() == "custom") {
  160.             $(".cslider_box_1_posts").fadeOut(200, function () {
  161.             $(".cslider_box_1_images").fadeOut(200);
  162.             $(".cslider_box_1_video").fadeOut(200);
  163.             $(".cslider_box_1_custom").fadeIn(200);
  164.             $(".cslider_box_1_3way").fadeIn(200);
  165.                     });
  166.                } else if ($(this).val() == "images")  {
  167.             $(".cslider_box_1_posts").fadeOut(200, function () {
  168.             $(".cslider_box_1_video").fadeOut(200);
  169.             $(".cslider_box_1_custom").fadeOut(200);
  170.             $(".cslider_box_1_images").fadeIn(200);
  171.             $(".cslider_box_1_3way").fadeIn(200);
  172.                     });
  173.                }
  174.     });
  175. $(".setting-cslider_box_panel_2_display").click(function () {
  176.                 if ($(this).val() == "images") {
  177.                     $(".cslider_box_2_posts").fadeOut(200, function () {
  178.             $(".cslider_box_2_video").fadeOut(200);
  179.             $(".cslider_box_2_custom").fadeOut(200);
  180.             $(".cslider_box_2_images").fadeIn(200);
  181.             $(".cslider_box_2_3way").fadeIn(200);
  182.                     });
  183.                    
  184.                } else if ($(this).val() == "video") {
  185.                     $(".cslider_box_2_posts").fadeOut(200, function () {
  186.             $(".cslider_box_2_images").fadeOut(200);
  187.             $(".cslider_box_2_custom").fadeOut(200);
  188.             $(".cslider_box_2_3way").fadeOut(200);
  189.             $(".cslider_box_2_video").fadeIn(200);
  190.                     });
  191.                 } else if ($(this).val() == "custom") {
  192.                      $(".cslider_box_2_posts").fadeOut(200, function () {
  193.             $(".cslider_box_2_images").fadeOut(200);
  194.             $(".cslider_box_2_video").fadeOut(200);
  195.             $(".cslider_box_2_custom").fadeIn(200);
  196.             $(".cslider_box_2_3way").fadeIn(200);
  197.                     });
  198.                } else if ($(this).val() == "posts") {
  199.                     $(".cslider_box_2_images").fadeOut(200, function () {
  200.             $(".cslider_box_2_video").fadeOut(200);
  201.             $(".cslider_box_2_custom").fadeOut(200);
  202.             $(".cslider_box_2_posts").fadeIn(200);
  203.             $(".cslider_box_2_3way").fadeIn(200);
  204.                     });
  205.                }
  206.     });
  207. $(".setting-cslider_box_panel_3_display").click(function () {
  208.                 if ($(this).val() == "images") {
  209.                     $(".cslider_box_3_posts").fadeOut(200, function () {
  210.             $(".cslider_box_3_video").fadeOut(200);
  211.             $(".cslider_box_3_custom").fadeOut(200);
  212.             $(".cslider_box_3_images").fadeIn(200);
  213.             $(".cslider_box_3_3way").fadeIn(200);
  214.                     });
  215.                    
  216.                } else if ($(this).val() == "video") {
  217.                     $(".cslider_box_3_posts").fadeOut(200, function () {
  218.             $(".cslider_box_3_images").fadeOut(200);
  219.             $(".cslider_box_3_custom").fadeOut(200);
  220.             $(".cslider_box_3_3way").fadeOut(200);
  221.             $(".cslider_box_3_video").fadeIn(200);
  222.                     });
  223.                } else if ($(this).val() == "custom") {
  224.                 $(".cslider_box_3_posts").fadeOut(200, function () {
  225.             $(".cslider_box_3_images").fadeOut(200);
  226.             $(".cslider_box_3_video").fadeOut(200);
  227.             $(".cslider_box_3_custom").fadeIn(200);
  228.             $(".cslider_box_3_3way").fadeIn(200);
  229.                     });
  230.                } else if ($(this).val() == "posts") {
  231.                     $(".cslider_box_3_images").fadeOut(200, function () {
  232.             $(".cslider_box_3_video").fadeOut(200);
  233.             $(".cslider_box_3_custom").fadeOut(200);
  234.             $(".cslider_box_3_posts").fadeIn(200);
  235.             $(".cslider_box_3_3way").fadeIn(200);
  236.                     });
  237.                }
  238.     });
  239. $(".setting-cslider_box_panel_4_display").click(function () {
  240.                 if ($(this).val() == "images") {
  241.             $(".cslider_box_4_posts").fadeOut(200, function () {
  242.             $(".cslider_box_4_video").fadeOut(200);
  243.             $(".cslider_box_4_custom").fadeOut(200);
  244.             $(".cslider_box_4_images").fadeIn(200);
  245.             $(".cslider_box_4_3way").fadeIn(200);
  246.                     });
  247.                    
  248.                } else if ($(this).val() == "video") {
  249.             $(".cslider_box_4_posts").fadeOut(200, function () {
  250.             $(".cslider_box_4_images").fadeOut(200);
  251.             $(".cslider_box_4_custom").fadeOut(200);
  252.             $(".cslider_box_4_3way").fadeOut(200);
  253.             $(".cslider_box_4_video").fadeIn(200);
  254.                     });
  255.                } else if ($(this).val() == "custom") {
  256.             $(".cslider_box_4_posts").fadeOut(200, function () {
  257.             $(".cslider_box_4_images").fadeOut(200);
  258.             $(".cslider_box_4_video").fadeOut(200);
  259.             $(".cslider_box_4_custom").fadeIn(200);
  260.             $(".cslider_box_4_3way").fadeIn(200);
  261.                     });
  262.                } else if ($(this).val() == "posts") {
  263.             $(".cslider_box_4_images").fadeOut(200, function () {
  264.             $(".cslider_box_4_video").fadeOut(200);
  265.             $(".cslider_box_3_custom").fadeOut(200);
  266.             $(".cslider_box_4_posts").fadeIn(200);
  267.             $(".cslider_box_4_3way").fadeIn(200);
  268.                     });
  269.                }
  270.     });
  271. $('div.cslider_box_1_post_image').toggleClass(function() {
  272.     if ($(this).parent().find('.cslider_panel_1_posts_enabled').is(':checked')) {
  273.     return 'showme';
  274.     } else {
  275.     return 'hideme';
  276.     }
  277.    
  278.  });
  279. $('div.cslider_panel_1_posts_enabled').click(function(){
  280.     $('div.cslider_box_1_post_image').removeClass('showme').toggleClass('hideme');
  281.     });
  282.  
  283.  
  284. $('div.cslider_box_2_post_image').toggleClass(function() {
  285.     if ($(this).parent().find('.cslider_panel_2_posts_enabled').is(':checked')) {
  286.     return 'showme';
  287.     } else {
  288.     return 'hideme';
  289.     }
  290.    
  291.  });
  292. $('div.cslider_panel_2_posts_enabled').click(function(){
  293.     $('div.cslider_box_2_post_image').removeClass('showme').toggleClass('hideme');
  294.     });
  295.  
  296.  
  297. $('div.cslider_box_3_post_image').toggleClass(function() {
  298.     if ($(this).parent().find('.cslider_panel_3_posts_enabled').is(':checked')) {
  299.     return 'showme';
  300.     } else {
  301.     return 'hideme';
  302.     }
  303.    
  304.  });
  305. $('div.cslider_panel_3_posts_enabled').click(function(){
  306.     $('div.cslider_box_3_post_image').removeClass('showme').toggleClass('hideme');
  307.     });
  308.  
  309. $('div.cslider_box_4_post_image').toggleClass(function() {
  310.     if ($(this).parent().find('.cslider_panel_4_posts_enabled').is(':checked')) {
  311.     return 'showme';
  312.     } else {
  313.     return 'hideme';
  314.     }
  315.    
  316.  });
  317. $('div.cslider_panel_4_posts_enabled').click(function(){
  318.     $('div.cslider_box_4_post_image').removeClass('showme').toggleClass('hideme');
  319.     });
  320. $(".cslider_panel_1_posts_enabled").click(function () {
  321.                 if ($(this).val() == "false") {
  322.             $(".setting-cslider_box_panel_1_excerpt_display").fadeIn(200);              
  323.                }  else if ($(this).val() == "false") {
  324.             $(".setting-cslider_box_panel_1_excerpt_display").fadeIn(200);
  325.                }
  326.              
  327.     });
  328. $(".cslider_panel_2_posts_enabled").click(function () {
  329.                 if ($(this).val() == "true") {
  330.             $(".setting-cslider_box_panel_2_excerpt_display").fadeIn(200);              
  331.                } else if ($(this).val() == "false") {
  332.             $(".setting-cslider_box_panel_2_excerpt_display").fadeIn(200);
  333.                }
  334.     });
  335. $(".cslider_panel_3_posts_enabled").click(function () {
  336.                 if ($(this).val() == "true") {
  337.             $(".setting-cslider_box_panel_3_excerpt_display").fadeIn(200);              
  338.                } else if ($(this).val() == "false") {
  339.             $(".setting-cslider_box_panel_3_excerpt_display").fadeIn(200);
  340.                }
  341.     });
  342. $(".cslider_panel_4_posts_enabled").click(function () {
  343.                 if ($(this).val() == "true") {
  344.             $(".setting-cslider_box_panel_4_excerpt_display").fadeIn(200);              
  345.                } else if ($(this).val() == "false") {
  346.             $(".setting-cslider_box_panel_4_excerpt_display").fadeIn(200);
  347.                }
  348.     });
  349. $(".setting-cslider_box_panel_1_image_display").click(function () {
  350.                 if ($(this).val() == "alignleft") {
  351.             $(".setting-cslider_box_panel_1_excerpt_display").fadeIn(200);              
  352.                } else if ($(this).val() == "alignright") {
  353.             $(".setting-cslider_box_panel_1_excerpt_display").fadeIn(200);
  354.                } else if ($(this).val() == "aligncenter") {
  355.             $(".setting-cslider_box_panel_1_excerpt_display").fadeOut(200);
  356.             }
  357.              
  358.     });
  359. $(".setting-cslider_box_panel_2_image_display").click(function () {
  360.                 if ($(this).val() == "alignleft") {
  361.             $(".setting-cslider_box_panel_2_excerpt_display").fadeIn(200);              
  362.                } else if ($(this).val() == "alignright") {
  363.             $(".setting-cslider_box_panel_2_excerpt_display").fadeIn(200);
  364.                } else if ($(this).val() == "aligncenter") {
  365.             $(".setting-cslider_box_panel_2_excerpt_display").fadeOut(200);
  366.             }
  367.              
  368.     });
  369. $(".setting-cslider_box_panel_3_image_display").click(function () {
  370.                 if ($(this).val() == "alignleft") {
  371.             $(".setting-cslider_box_panel_3_excerpt_display").fadeIn(200);              
  372.                } else if ($(this).val() == "alignright") {
  373.             $(".setting-cslider_box_panel_3_excerpt_display").fadeIn(200);
  374.                } else if ($(this).val() == "aligncenter") {
  375.             $(".setting-cslider_box_panel_3_excerpt_display").fadeOut(200);
  376.             }
  377.              
  378.     });
  379. $(".setting-cslider_box_panel_4_image_display").click(function () {
  380.                 if ($(this).val() == "alignleft") {
  381.             $(".setting-cslider_box_panel_4_excerpt_display").fadeIn(200);              
  382.                } else if ($(this).val() == "alignright") {
  383.             $(".setting-cslider_box_panel_4_excerpt_display").fadeIn(200);
  384.                } else if ($(this).val() == "aligncenter") {
  385.             $(".setting-cslider_box_panel_4_excerpt_display").fadeOut(200);
  386.             }
  387.              
  388.     });
  389. });
  390. function smartColumns() { //Create a function that calculates the smart columns
  391.  
  392.         //Reset column size to a 100% once view port has been adjusted
  393.     $("ul.column").css({ 'width' : "100%"});
  394.  
  395.     var colWrap = $("ul.column").width(); //Get the width of row
  396.     var colNum = Math.floor(colWrap / 260); //Find how many columns of 200px can fit per row / then round it down to a whole number
  397.     var colFixed = Math.floor(colWrap / colNum); //Get the width of the row and divide it by the number of columns it can fit / then round it down to a whole number. This value will be the exact width of the re-adjusted column
  398.  
  399.     $("ul.column").css({ 'width' : colWrap}); //Set exact width of row in pixels instead of using % - Prevents cross-browser bugs that appear in certain view port resolutions.
  400.     $("ul.column li").css({ 'width' : colFixed}); //Set exact width of the re-adjusted column  
  401.  
  402. }  
  403.  
  404. function smartColumns() {//Execute the function when page loads
  405.  
  406. $(window).resize(function () { //Each time the viewport is adjusted/resized, execute the function
  407.     smartColumns();
  408. });
  409. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement