$(document).ready(function(){ //自動撥放 var autoEbookPlayIDindex = 0; var autoEbookPlayID = setInterval(function(){ var pics = $("#catalogue_img").attr("tops").split(","); var length = pics.length; if(length > 1){ autoEbookPlayIDindex++; if(autoEbookPlayIDindex > length - 1)autoEbookPlayIDindex = 0; $("#catalogue_img").attr("src",'/upload_files/product/' + pics[autoEbookPlayIDindex]); } else{ clearInterval(autoEbookPlayID); } }, 5000); $("#catalogue_img").css({"cursor": "pointer"}).click(function(event){ var EID = $(this).attr('EID'); var cname = $(this).attr('cname'); var brand_name = $(this).attr('brand_name') || null; var sex = $(this).attr('sex') || null var age_range = $(this).attr('age_range') || null; $(document).scrollTop(0); $("body").append('
'); if($.browser.msie){ var flash_str = ''; } else{ var flash_str = '' ; } $("#catalogue_Div").css({ "position": "absolute", "width": "1003px", "height": "740px", "left": $(window).width() / 2 - 1003 / 2 + "px", //"top": $(window).height() / 2 - 740 / 2 + "px", "top": "20px", "border": "1px solid #000", "z-index": 50 }).html(flash_str).click(function(event){ event.stopPropagation(); }); event.stopPropagation(); }); /* $(document).click(function(){ $("#catalogue_Div").remove(); }); */ }); function closeCatalogue_Div(){ $("#catalogue_Div").remove(); } function ebookPerview(product_id, color_code){ $("#catalogue_Div").hide(); $("body").append(""); $("#ebookPerview_iframe,#ebookPerview_mask_Div").css({ "width":$(document).width(), "height":$(document).height(), "top": 0, "left": 0, "position": "absolute", "opacity": "0", "z-index": 50 }); $("#ebookPerview_mask_Div").css({"opacity": "0.5","background-color" :"#000"}); var SendStr = "&product_id=" + product_id + "&color_code=" + color_code; var boxWidth = 438; var boxHeight =420; $("body").append(""); $("#ebookPerview_Div").css({ "position": "absolute", "left": $(window).width()/2 - boxWidth/2, "top": $(window).height()/2 - boxHeight/2, "z-index": 50 }).hide(); $.ajax({ type: "post", url: "/ebook/ebook_preview.php", data: SendStr , context: $("#ebookPerview_Div"), success: function(html){ $(this).html(html).fadeIn(100); } }); //關閉 $(".close_ebookPreview").live("click",function(){ $("#ebookPerview_iframe,#ebookPerview_mask_Div,#ebookPerview_Div").remove(); $("#catalogue_Div").show(); $("#SizeTb_Div").remove(); }); //變換顏色 $(".color_default_ebook").live("click",function(){ var SendStr = $(this).attr('SendStr'); $.ajax({ type: "POST", url: "/ebook/ebook_preview.php", context: $("#ebookPerview_Div"), data: SendStr, success: function(html){ $(this).html(html); } }); }); }