// GENERAL SCRIPT // LAST UPDATE: 07-11-2014 jQuery(document).ready(function($) { //COPYRIGHT YEAR var d = new Date(); var x = $("#footeryear"); var y = d.getFullYear(); x.html(y); /* ---------------------------------------------------------------------- */ /* Mob Menu /* ---------------------------------------------------------------------- */ var currentMenu = $("#main_menu .menu li.active a").text(); $("#header #main_menu").append('
'); $("#mob_menu span").html(currentMenu); $("#mob_menu").click(function () { $("#main_menu .menu").slideToggle(); return false }); /* ---------------------------------------------------------------------- */ /* History & Redeem List for mob /* ---------------------------------------------------------------------- */ if ($(window).width() > 959) { }; if ($(window).width() < 720) { var newPath = "../images/arrow_history.png"; $(".dot_list img.clip").attr({ src: newPath }); /* History */ $('.history_details .hd_date br').replaceWith(' / '); $(".history_details .hd_date").prepend ('日期/時間:  '); $(".history_details .hd_desc").prepend ('詳細資料:  '); $(".history_details .hd_ap").prepend ('賺取(分):  '); $(".history_details .hd_lp").prepend ('消費(分):  '); $(".history_details .hd_amount").prepend ('惠顧金額($):  '); $(".history_details .hd_refno").prepend ('參考編號:  '); $(".history_details .hd_remark").prepend ('備註:  '); /* Redeem */ $(".redeem_details .rd_desc").prepend ('換購詳情:  '); $(".redeem_details .rd_price").prepend ('正價($):  '); $(".redeem_details .rd_point").prepend ('換購積分(分):  '); $(".redeem_details .rd_amount").prepend ('換購金額($):  '); $(".redeem_details .rd_qty").prepend ('數量:  '); }; /* ---------------------------------------------------------------------- */ /* Back to Top /* ---------------------------------------------------------------------- */ $("body").append('
返回頂部
'); (function() { oldiOS = false, oldAndroid = false; // Detect if older iOS device, which doesn't support fixed position if( /(iPhone|iPod|iPad)\sOS\s[0-4][_\d]+/i.test(navigator.userAgent) ) oldiOS = true; // Detect if older Android device, which doesn't support fixed position if( /Android\s+([0-2][\.\d]+)/i.test(navigator.userAgent) ) oldAndroid = true; $('#back-to-top').click(function( e ){ $('html, body').animate({ scrollTop : 0 }, 500 ); e.preventDefault(); }); $(window).scroll(function() { var position = $(window).scrollTop(); if( oldiOS || oldAndroid ) { $( settings.button ).css({ 'position' : 'absolute', 'top' : position + $(window).height() }); } if ( position > 200 ) $( '#back-to-top' ).fadeIn( 400 ); else $( '#back-to-top' ).fadeOut( 400 ); }); })(); /* end UItoTop (Back to Top) */ });