// Usage // // require.register("browser/debug.js", function(module, exports, require){ // // Module code goes here // }); // // var debug = require("browser/debug.js"); function require(p) { var path = require.resolve(p); var mod = require.modules[path]; if (!mod) throw new Error('failed to require "' + p + '"'); if (!mod.exports) { mod.exports = {}; mod.call(mod.exports, mod, mod.exports, require.relative(path)); } return mod.exports; } require.modules = {}; require.resolve = function(path) { var orig = path; var reg = path + ".js"; var index = path + "/index.js"; return ( (require.modules[reg] && reg) || (require.modules[index] && index) || orig ); }; require.register = function(path, fn) { require.modules[path] = fn; }; require.relative = function(parent) { return function(p) { if ("." != p.charAt(0)) return require(p); var path = parent.split("/"); var segs = p.split("/"); path.pop(); for (var i = 0; i < segs.length; i++) { var seg = segs[i]; if (".." == seg) path.pop(); else if ("." != seg) path.push(seg); } return require(path.join("/")); }; }; require.register("modules/module.js", function(module, exports, require) { module.exports = { smallPicBox, videoBox, zoomBox }; }); // ========================================================== // 小圖hover效果及切換功能 // ========================================================== function smallPicBox() { // if($(".moreview .picitem ").length > 5){ // $(".productView .moreview").owlCarousel({ // loop:false, // items : 5, // nav : true, // }).on('mouseleave','.owl-stage-outer', function() { // $(".productView .zoonbox").removeAttr('style'); // }) // .on('click','.owl-item', function() { // var now = $(this).index(); // $(".productView .owl-item").not(this).find('.picitem').removeClass('now'); // $(this).find('.picitem').addClass('now'); // $(".productView .zoonbox").removeClass('now').eq(now).addClass('now'); // }) // .on('mouseenter','.owl-item', function() { // var now = $(this).index(); // //var nowbox = $('.productImg .now').index(); // //console.log(nowbox ); // $(".productView .zoonbox").css('display','none').eq(now).css('display','block'); // //$('.productImg .now').css('display','none'); // }) // .on('mouseleave','.owl-item', function() { // var now = $(this).index(); // $(".productView .zoonbox").eq(now).css('display','none'); // }); // }else{ $(".productView .moreview") .on('mouseleave', function() { $(".productView .zoonbox").removeAttr('style'); }) .on('click','.picitem', function() { var now = $(this).index(); $(".productView .picitem").removeClass('now'); $(this).addClass('now'); $(".productView .zoonbox").removeClass('now').eq(now).addClass('now'); }) .on('mouseenter','.picitem', function() { var now = $(this).index(); //var nowbox = $('.productImg .now').index(); $(".productView .zoonbox").css('display','none').eq(now).css('display','block'); //$('.productImg .now').css('display','none'); }) .on('mouseleave','.picitem', function() { var now = $(this).index(); $(".productView .zoonbox").eq(now).css('display','none'); }); // } } // ========================================================== // 影片效果 // ========================================================== function videoBox(){ //影片控制 $(".moreview").on('click','.video_control',function(){ var video = document.getElementById("Video"); if(video.paused){ $(this).addClass('fa-pause').removeClass('fa-play'); video.play(); }else{ $(this).addClass('fa-play').removeClass('fa-pause'); video.pause(); } }); //影片預覽圖 if(document.getElementById("Video")){ document.getElementById("Video").oncanplay=function(){ var video = $("#Video").get(0); var canvas = document.getElementById("video_review"); canvas.getContext('2d').drawImage(video, 0, 0, 66, 92); }; } } // ========================================================== // // ========================================================== function zoomBox(){ var ImgBox,ImgBox_h,ImgBox_w,viewbox,viewbox_h,viewbox_w,mouseY,mouseX,preview,preview_img,scale_h,scale_w; preview_str = '