View Product
update_hash('products'); window.do_popup = false; update_hash('products/'); window.do_popup = ''; $('#product_stuff').jScrollPane(); var jsp = $('#product_stuff').data('jsp'); $('#product_stuff').masonry({ itemSelector : '.product_small', columnWidth : 150 }, function(){ jsp.reinitialise(); }); $('.new_cell .main_product_image img').attr('orgWidth', $('.new_cell .main_product_image img').width()); $('.new_cell .main_product_image img').attr('orgHeight', $('.new_cell .main_product_image img').height()); $('.new_cell .main_product_image img').each(function(){ var orgWidth = $(this).attr('orgWidth'); var orgHeight = $(this).attr('orgHeight'); var holderWidth = 500; var holderHeight = $(this).parent().parent().height(); var newRatio = holderWidth/orgWidth; if(orgHeight*newRatio>holderHeight){ var newRatio = holderHeight/orgHeight; $(this).css('margin-top', (holderHeight-(newRatio*orgHeight))*0.5); }else{ $(this).css('margin-top', (holderHeight-(newRatio*orgHeight))*0.5); } $(this).width(orgWidth*newRatio); $(this).height(orgHeight*newRatio); }); $('.main_product_image img').load(function(){ $('.main_product_image img').attr('orgWidth', $('.main_product_image img').width()); $('.main_product_image img').attr('orgHeight', $('.main_product_image img').height()); check_width(); $('.main_product_image').css('opacity', 1); }); $('.next_button').click(function(e){ e.preventDefault(); next_product(); }); $('.prev_button').click(function(e){ e.preventDefault(); prev_product(); }); $('.product_image, .bottom_product_image').css('opacity', '0.5'); $('.product_image, .bottom_product_image').hover(function(){ $(this).stop().fadeTo(300, 1); },function(){ $(this).stop().fadeTo(300, 0.5); }); $('.product_image, .bottom_product_image').click(function(e){ e.preventDefault(); var newUrl = $(this).attr('data-url'); if(newUrl!=$('.main_product_image img').attr('src')){ $('.main_product_image img').css('width', 'auto'); $('.main_product_image img').css('height', 'auto'); $('.main_product_image').css('opacity', 0); $('.main_product_image img').attr('src', newUrl); } }); $('.comment_button').click(function(e){ e.preventDefault(); $.colorbox({ href:"comments.php?ref="+$(this).attr('data-url'), innerWidth:400 }); }); $('.splash_page_image a').click(function(e){ e.preventDefault(); load_new_page($(this).attr('data-url'),2,$(this).attr('data-col')); }); $('.product_small').hover(function(){ $(this).siblings('a').stop(true,true).animate({ opacity : .4 }, 150); $(this).find('span').stop(true, true).fadeIn(); }, function(){ $(this).siblings('a').stop(true,true).delay(50).animate({ opacity : 1 }, 250); $(this).find('span').stop(true, true).fadeOut(200); }); $('.product_small').live('click',function(e){ e.preventDefault(); var slug = $(this).attr('data-slug'); productPopup(slug, 'BASE_URL'); }); $('#shares .addthis_button_compact').trigger('mouseover'); setTimeout("$('#at15s').hide();", 1000);