layout.js 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. (function($){
  2. var initLayout = function() {
  3. var hash = window.location.hash.replace('#', '');
  4. var currentTab = $('ul.navigationTabs a')
  5. .bind('click', showTab)
  6. .filter('a[rel=' + hash + ']');
  7. if (currentTab.size() == 0) {
  8. currentTab = $('ul.navigationTabs a:first');
  9. }
  10. showTab.apply(currentTab.get(0));
  11. $('a.lightsGal').zoomimage();
  12. $('a.bwGal').zoomimage({
  13. border: 20,
  14. centered: true,
  15. hideSource: true
  16. });
  17. $('a.customGal').zoomimage({
  18. controlsTrigger: 'mouseover',
  19. className: 'custom',
  20. shadow: 40,
  21. controls: false,
  22. opacity: 1,
  23. beforeZoomIn: function(boxID) {
  24. $('#' + boxID)
  25. .find('img')
  26. .css('opacity', 0)
  27. .animate(
  28. {'opacity':1},
  29. { duration: 500, queue: false }
  30. );
  31. },
  32. beforeZoomOut: function(boxID) {
  33. $('#' + boxID)
  34. .find('img')
  35. .css('opacity', 1)
  36. .animate(
  37. {'opacity':0},
  38. { duration: 500, queue: false }
  39. );
  40. }
  41. });
  42. };
  43. var showTab = function(e) {
  44. var tabIndex = $('ul.navigationTabs a')
  45. .removeClass('active')
  46. .index(this);
  47. $(this)
  48. .addClass('active')
  49. .blur();
  50. $('div.zooimage').zoomimageClear();
  51. $('div.tab')
  52. .hide()
  53. .eq(tabIndex)
  54. .show();
  55. };
  56. EYE.register(initLayout, 'init');
  57. })(jQuery)