Diff
checker
文本
文本
圖像
文檔
Excel
文件夾
Legal
Enterprise
桌面版
定價
登入
下載 Diffchecker 桌面版
比較文本
尋找兩個文字檔案之間的差異
工具
歷史
即時編輯器
隱藏空白變更
摺疊未變更行
關閉換行
檢視
拆分
統一
比對精度
智能
單詞
字符
文字樣式
變更外觀
語法突出顯示
選擇語法
忽略
文字轉換
前往第一個差異
編輯輸入
Diffchecker Desktop
執行Diffchecker最安全的方式。取得Diffchecker桌面應用程式:您的差異永遠不會離開您的電腦!
取得桌面版
Untitled diff
建立於
10 年前
差異永不過期
清除
匯出
分享
解釋
42 刪除
行
總計
刪除
字符
總計
刪除
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
150 行
全部複製
215 新增
行
總計
新增
字符
總計
新增
要繼續使用此功能,請升級到
Diff
checker
Pro
查看價格
327 行
全部複製
(function()
(function()
{
{
var touch = window.ontouchstart
var touch = window.ontouchstart
|| navigator.MaxTouchPoints > 0
|| navigator.MaxTouchPoints > 0
|| navigator.msMaxTouchPoints > 0;
|| navigator.msMaxTouchPoints > 0;
is_touch_device();
is_touch_device();
if (touch == true) { // remove all :hover stylesheets
if (touch == true) { // remove all :hover stylesheets
try { // prevent crash on browsers not supporting DOM styleSheets properly
try { // prevent crash on browsers not supporting DOM styleSheets properly
for (var si in document.styleSheets) {
for (var si in document.styleSheets) {
var styleSheet = document.styleSheets[si];
var styleSheet = document.styleSheets[si];
if (!styleSheet.rules) continue;
if (!styleSheet.rules) continue;
for (var ri = styleSheet.rules.length - 1; ri >= 0; ri--) {
for (var ri = styleSheet.rules.length - 1; ri >= 0; ri--) {
if (!styleSheet.rules[ri].selectorText) continue;
if (!styleSheet.rules[ri].selectorText) continue;
if (styleSheet.rules[ri].selectorText.match(':hover')) {
if (styleSheet.rules[ri].selectorText.match(':hover')) {
stylesheet.deleteRule(ri);
stylesheet.deleteRule(ri);
}
}
}
}
}
}
} catch (ex) {}
} catch (ex) {}
}
}
複製
已複製
複製
已複製
$(window).on('scroll', checkAnchors);
$('.main-nav, .mobile-nav').on('click','div',navClick);
$('body').on('click', '.rsvp', function ()
{
//
});
$('.schedule-info').on('click', function ()
{
if ($('div', this).hasClass('active'))
{
$('div', this).removeClass('active');
}
else
{
$('div', this).addClass('active');
}
});
$('.answer-open').on('click', function ()
{
if ($(this).hasClass('active'))
{
$(this).removeClass('active');
var answerParent = $(this).parent();
$('.faq-answer', answerParent).removeClass('active');
}
else
{
$(this).addClass('active');
var answerParent = $(this).parent();
$('.faq-answer', answerParent).addClass('active');
}
});
$('.mobile-menu-link').on('click', function (e)
{
e.preventDefault();
if ($('.mobile-nav').hasClass('active')) {
$('.mobile-nav').removeClass('active');
$('.mobile-nav-cover').removeClass('active');
}
else
{
$('.mobile-nav').addClass('active');
$('.mobile-nav-cover').addClass('active');
}
});
$('.rewards-link').on('click', function (e)
$('.rewards-link').on('click', function (e)
{
{
e.preventDefault();
e.preventDefault();
$('.rewards-pop-up').addClass('active');
$('.rewards-pop-up').addClass('active');
$('.cover').addClass('active');
$('.cover').addClass('active');
});
});
$('.rewards-pop-up-close-btn').on('click', function ()
$('.rewards-pop-up-close-btn').on('click', function ()
{
{
$('.rewards-pop-up').removeClass('active');
$('.rewards-pop-up').removeClass('active');
$('.cover').removeClass('active');
$('.cover').removeClass('active');
});
});
複製
已複製
複製
已複製
$('.
videoStill
').magnificPopup({
$('.
trailer-house
').magnificPopup({
delegate: '
img
', // child items selector, by clicking on it popup will open
delegate: '
i
', // child items selector, by clicking on it popup will open
type: 'iframe',
type: 'iframe',
gallery:
gallery:
{
{
enabled:true
enabled:true
}
}
// other options
// other options
});
});
複製
已複製
複製
已複製
$('.travel-info-image').magnificPopup({
delegate: 'img', // child items selector, by clicking on it popup will open
type: 'image',
gallery:
{
enabled:false
}
// other options
});
//if (touch == false) {
//if (touch == false) {
// $('.digital-link').on('mouseenter', function (e)
// $('.digital-link').on('mouseenter', function (e)
// {
// {
// var currentSource = $('img', this).attr('src');
// var currentSource = $('img', this).attr('src');
// var newSource = currentSource.replace('.png', '_hover.png');
// var newSource = currentSource.replace('.png', '_hover.png');
// $('img', this).attr('src', newSource);
// $('img', this).attr('src', newSource);
// });
// });
// $('.digital-link').on('mouseleave', function (e)
// $('.digital-link').on('mouseleave', function (e)
// {
// {
// var currentSource = $('img', this).attr('src');
// var currentSource = $('img', this).attr('src');
// var newSource = currentSource.replace('_hover.png', '.png');
// var newSource = currentSource.replace('_hover.png', '.png');
// $('img', this).attr('src', newSource);
// $('img', this).attr('src', newSource);
// });
// });
//}
//}
$('.digital-link').on('click', function (e)
$('.digital-link').on('click', function (e)
{
{
e.preventDefault();
e.preventDefault();
if ($(this).attr('href').search('playstation.com') != -1) {
if ($(this).attr('href').search('playstation.com') != -1) {
var storeLink = 'PlayStation Store';
var storeLink = 'PlayStation Store';
}
}
else if ($(this).attr('href').search('xbox.com') != -1) {
else if ($(this).attr('href').search('xbox.com') != -1) {
var storeLink = 'Xbox Store';
var storeLink = 'Xbox Store';
}
}
else if ($(this).attr('href').search('steampowered.com') != -1) {
else if ($(this).attr('href').search('steampowered.com') != -1) {
var storeLink = 'Steam Store';
var storeLink = 'Steam Store';
}
}
else if ($(this).attr('href').search('square') != -1) {
else if ($(this).attr('href').search('square') != -1) {
var storeLink = 'Square Enix Store';
var storeLink = 'Square Enix Store';
}
}
if ($(this).hasClass('windows-10')) {
if ($(this).hasClass('windows-10')) {
複製
已複製
複製
已複製
var storeLink = 'Windows 10';
//
if ($(this).attr('href') == '#') {
//
}
else
{
var url = window.location;
var urlExtension = parseUrl(url).search;
if (typeof urlExtension[1] != 'undefined') {
var splitUrlExtension = urlExtension.split('?');
var paramsArray = splitUrlExtension[1].split('&');
var paramsSplit = {};
$(paramsArray).each(function (idx)
{
var splitString = this.split('=');
paramsSplit[splitString[0]] = splitString[1];
});
var fullWindowsEtension = '';
if ('utm_campaign' in paramsSplit) {
fullWindowsEtension += '_'+paramsSplit['utm_campaign'];
}
if ('utm_source' in paramsSplit) {
fullWindowsEtension += '_'+paramsSplit['utm_source'];
}
if ('utm_content' in paramsSplit) {
fullWindowsEtension += '_'+paramsSplit['utm_content'];
}
}
ga('send', 'event', 'Store Link Click', storeLink);
window.open('https://www.microsoft.com/en-us/store/games/rise-of-the-tomb-raider/9nblggh6crsz?cid=SEA_ROTTR_W10'+fullWindowsEtension, '_blank');
}
}
}
else
else
{
{
ga('send', 'event', 'Store Link Click', storeLink);
ga('send', 'event', 'Store Link Click', storeLink);
var url = window.location;
var url = window.location;
var urlExtension = parseUrl(url).search;
var urlExtension = parseUrl(url).search;
window.open($(this).attr('href')+urlExtension);
window.open($(this).attr('href')+urlExtension);
}
}
});
});
複製
已複製
複製
已複製
var language = $('body').attr('
lang');
var language = $('body').attr('
data-attr-
lang');
var currentFlag
= $('#'+language+'-flag').detach();
$("#timer").countdown({
date: "february 5, 2016 16:00",
yearsAndMonths: false,
template: '<span class="time-text">%td</span> %d <span class="time-text">%th</span> <span class="time-text-2">%h</span> <span class="time-text">%ti</span> <span class="time-text-2">%i</span> <span class="time-text">%ts</span> <span class="time-text-2">%s</span>',
});
$("#timer").countdown("changeLocale", language);
var currentFlag
;
$('.flag-inner a').each(function ()
{
if ($(this).attr('data-country-code') == language)
{
currentFlag = $(this).detach();
}
});
$('.flag-container .flag-inner').prepend(currentFlag);
$('.flag-container .flag-inner').prepend(currentFlag);
$('.flag-container .flag-inner').on('click', 'div.flag', function ()
$('.flag-container .flag-inner').on('click', 'div.flag', function ()
{
{
var newLocale = ($(this).attr('id')).replace('-flag', '');
var newLocale = ($(this).attr('id')).replace('-flag', '');
var newUrl = (window.location.href).split('/');
var newUrl = (window.location.href).split('/');
newUrl = newUrl[0] + '//' + newUrl[2] + '/';
newUrl = newUrl[0] + '//' + newUrl[2] + '/';
window.location.href = newUrl+newLocale;
window.location.href = newUrl+newLocale;
});
});
複製
已複製
複製
已複製
if (typeof xboxRetailersArray !== 'undefined') {
var parsedXbox = $.parseJSON(xboxRetailersArray);
$.each(parsedXbox, function ()
{
$('.linksHouse.retailers.xbox').append('<a href="'+this.link[0]+'" class="retailer-link" />');
$('.linksHouse.retailers.xbox a:last').append('<img src="'+this.logo+'" class="retailer-logo" />');
});
}
if (typeof ps4RetailersArray !== 'undefined')
{
var parsedPS4 = $.parseJSON(ps4RetailersArray);
$.each(parsedPS4, function ()
{
$('.linksHouse.retailers.ps4').append('<a href="'+this.link[0]+'" class="retailer-link" />');
$('.linksHouse.retailers.ps4 a:last').append('<img src="'+this.logo+'" class="retailer-logo" />');
});
}
if (typeof pcRetailersArray !== 'undefined')
if (typeof pcRetailersArray !== 'undefined')
{
{
var parsedPC = $.parseJSON(pcRetailersArray);
var parsedPC = $.parseJSON(pcRetailersArray);
$.each(parsedPC, function ()
$.each(parsedPC, function ()
{
{
複製
已複製
複製
已複製
$('.linksHouse.retailers.pc').append('<a href="'+this.link
+'" class="retailer-link" />');
$('.linksHouse.retailers.pc').append('<a href="'+this.link
[0]
+'" class="retailer-link" />');
$('.linksHouse.retailers.pc a:last').append('<img src="'+this.logo+'" class="retailer-logo" />');
$('.linksHouse.retailers.pc a:last').append('<img src="'+this.logo+'" class="retailer-logo" />');
});
});
}
}
}) ();
}) ();
複製
已複製
複製
已複製
function is_touch_device() {
function is_touch_device() {
return 'ontouchstart' in window // works on most browsers
return 'ontouchstart' in window // works on most browsers
|| 'onmsgesturechange' in window; // works on ie10
|| 'onmsgesturechange' in window; // works on ie10
}
}
複製
已複製
複製
已複製
function parseUrl( url ) {
function parseUrl( url ) {
var a = document.createElement('a');
var a = document.createElement('a');
a.href = url;
a.href = url;
return a;
return a;
}
function navClick (e) {
e.preventDefault();
$(window).off('scroll', checkAnchors);
$('.mobile-nav').removeClass('active');
$('.mobile-nav-cover').removeClass('active');
if ($(this).hasClass('active'))
{
//
}
else
{
$('.nav-item, .mobile-nav-item').each(function ()
{
$(this).removeClass('active');
});
$(this).addClass('active');
if ($(this).attr('id') == 'forums') {
window.location = 'http://forum.finalfantasyxv.com';
}
else
{
//calculate destination place
var dest = 0;
if ($(window).width() <= 1024) {
console.log('little screen');
if ($('a[href=#'+$(this).attr('id')+']').offset().top - $(window).height() * -.15 > $(document).height() - $(window).height()) {
dest = $(document).height() - $(window).height();
} else {
dest = $('a[href=#'+$(this).attr('id')+']').offset().top - $(window).height() * -.15;
}
}
else
{
if ($('a[href=#'+$(this).attr('id')+']').offset().top - $(window).height() * .25 > $(document).height() - $(window).height()) {
dest = $(document).height() - $(window).height();
} else {
dest = $('a[href=#'+$(this).attr('id')+']').offset().top - $(window).height() * .25;
}
}
}
複製
已複製
複製
已複製
//go to destination
$('html,body').animate({
scrollTop: dest
}, 500, 'swing', function ()
{
$(window).on('scroll', checkAnchors);
});
}
}
}
function checkAnchors ()
{
//var homeLoc = ($('a[href=#home]').offset().top) - ($(window).height() * .3);
//var whatLoc = $('a[href=#what]').offset().top - ($(window).height() * .3);
//var trailerLoc = $('a[href=#trailer]').offset().top - ($(window).height() * .3);
//var livestreamLoc = $('a[href=#livestream]').offset().top - ($(window).height() * .3);
//var scheduleLoc = $('a[href=#schedule]').offset().top - ($(window).height() * .3);
//var travelLoc = $('a[href=#travel]').offset().top - ($(window).height() * .3);
//var faqLoc = $('a[href=#faq]').offset().top - ($(window).height() * .3);
//
//if ( $(window).scrollTop() > homeLoc && $(window).scrollTop() < whatLoc)
//{
// $('.nav-item, .mobile-nav-item').each(function ()
// {
// $(this).removeClass('active');
// });
// $('.main-nav div[id=home], .mobile-nav div[id=home]').addClass('active');
//}
//if ( $(window).scrollTop() > whatLoc && $(window).scrollTop() < trailerLoc)
//{
// $('.nav-item, .mobile-nav-item').each(function ()
// {
// $(this).removeClass('active');
// });
// $('.main-nav div[id=what], .mobile-nav div[id=what]').addClass('active');
//}
//if ( $(window).scrollTop() > trailerLoc && $(window).scrollTop() < livestreamLoc)
//{
// $('.nav-item, .mobile-nav-item').each(function ()
// {
// $(this).removeClass('active');
// });
// $('.main-nav div[id=trailer], .mobile-nav div[id=trailer]').addClass('active');
//}
//if ( $(window).scrollTop() > livestreamLoc && $(window).scrollTop() < scheduleLoc)
//{
// $('.nav-item, .mobile-nav-item').each(function ()
// {
// $(this).removeClass('active');
// });
// $('.main-nav div[id=livestream], .mobile-nav div[id=livestream]').addClass('active');
//}
//if ( $(window).scrollTop() > scheduleLoc && $(window).scrollTop() < travelLoc)
//{
// $('.nav-item, .mobile-nav-item').each(function ()
// {
// $(this).removeClass('active');
// });
// $('.main-nav div[id=schedule], .mobile-nav div[id=schedule]').addClass('active');
//}
//if ( $(window).scrollTop() > travelLoc && $(window).scrollTop() < faqLoc)
//{
// $('.nav-item, .mobile-nav-item').each(function ()
// {
// $(this).removeClass('active');
// });
// $('.main-nav div[id=travel], .mobile-nav div[id=travel]').addClass('active');
//}
//if ( $(window).scrollTop() > faqLoc)
//{
// $('.nav-item, .mobile-nav-item').each(function ()
// {
// $(this).removeClass('active');
// });
// $('.main-nav div[id=faq], .mobile-nav div[id=faq]').addClass('active');
//}
}
已保存差異
原始文本
開啟檔案
(function() { var touch = window.ontouchstart || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; is_touch_device(); if (touch == true) { // remove all :hover stylesheets try { // prevent crash on browsers not supporting DOM styleSheets properly for (var si in document.styleSheets) { var styleSheet = document.styleSheets[si]; if (!styleSheet.rules) continue; for (var ri = styleSheet.rules.length - 1; ri >= 0; ri--) { if (!styleSheet.rules[ri].selectorText) continue; if (styleSheet.rules[ri].selectorText.match(':hover')) { stylesheet.deleteRule(ri); } } } } catch (ex) {} } $('.rewards-link').on('click', function (e) { e.preventDefault(); $('.rewards-pop-up').addClass('active'); $('.cover').addClass('active'); }); $('.rewards-pop-up-close-btn').on('click', function () { $('.rewards-pop-up').removeClass('active'); $('.cover').removeClass('active'); }); $('.videoStill').magnificPopup({ delegate: 'img', // child items selector, by clicking on it popup will open type: 'iframe', gallery: { enabled:true } // other options }); //if (touch == false) { // $('.digital-link').on('mouseenter', function (e) // { // var currentSource = $('img', this).attr('src'); // var newSource = currentSource.replace('.png', '_hover.png'); // $('img', this).attr('src', newSource); // }); // $('.digital-link').on('mouseleave', function (e) // { // var currentSource = $('img', this).attr('src'); // var newSource = currentSource.replace('_hover.png', '.png'); // $('img', this).attr('src', newSource); // }); //} $('.digital-link').on('click', function (e) { e.preventDefault(); if ($(this).attr('href').search('playstation.com') != -1) { var storeLink = 'PlayStation Store'; } else if ($(this).attr('href').search('xbox.com') != -1) { var storeLink = 'Xbox Store'; } else if ($(this).attr('href').search('steampowered.com') != -1) { var storeLink = 'Steam Store'; } else if ($(this).attr('href').search('square') != -1) { var storeLink = 'Square Enix Store'; } if ($(this).hasClass('windows-10')) { var storeLink = 'Windows 10'; if ($(this).attr('href') == '#') { // } else { var url = window.location; var urlExtension = parseUrl(url).search; if (typeof urlExtension[1] != 'undefined') { var splitUrlExtension = urlExtension.split('?'); var paramsArray = splitUrlExtension[1].split('&'); var paramsSplit = {}; $(paramsArray).each(function (idx) { var splitString = this.split('='); paramsSplit[splitString[0]] = splitString[1]; }); var fullWindowsEtension = ''; if ('utm_campaign' in paramsSplit) { fullWindowsEtension += '_'+paramsSplit['utm_campaign']; } if ('utm_source' in paramsSplit) { fullWindowsEtension += '_'+paramsSplit['utm_source']; } if ('utm_content' in paramsSplit) { fullWindowsEtension += '_'+paramsSplit['utm_content']; } } ga('send', 'event', 'Store Link Click', storeLink); window.open('https://www.microsoft.com/en-us/store/games/rise-of-the-tomb-raider/9nblggh6crsz?cid=SEA_ROTTR_W10'+fullWindowsEtension, '_blank'); } } else { ga('send', 'event', 'Store Link Click', storeLink); var url = window.location; var urlExtension = parseUrl(url).search; window.open($(this).attr('href')+urlExtension); } }); var language = $('body').attr('lang'); var currentFlag = $('#'+language+'-flag').detach(); $('.flag-container .flag-inner').prepend(currentFlag); $('.flag-container .flag-inner').on('click', 'div.flag', function () { var newLocale = ($(this).attr('id')).replace('-flag', ''); var newUrl = (window.location.href).split('/'); newUrl = newUrl[0] + '//' + newUrl[2] + '/'; window.location.href = newUrl+newLocale; }); if (typeof pcRetailersArray !== 'undefined') { var parsedPC = $.parseJSON(pcRetailersArray); $.each(parsedPC, function () { $('.linksHouse.retailers.pc').append('<a href="'+this.link+'" class="retailer-link" />'); $('.linksHouse.retailers.pc a:last').append('<img src="'+this.logo+'" class="retailer-logo" />'); }); } }) (); function is_touch_device() { return 'ontouchstart' in window // works on most browsers || 'onmsgesturechange' in window; // works on ie10 } function parseUrl( url ) { var a = document.createElement('a'); a.href = url; return a; }
更改後文本
開啟檔案
(function() { var touch = window.ontouchstart || navigator.MaxTouchPoints > 0 || navigator.msMaxTouchPoints > 0; is_touch_device(); if (touch == true) { // remove all :hover stylesheets try { // prevent crash on browsers not supporting DOM styleSheets properly for (var si in document.styleSheets) { var styleSheet = document.styleSheets[si]; if (!styleSheet.rules) continue; for (var ri = styleSheet.rules.length - 1; ri >= 0; ri--) { if (!styleSheet.rules[ri].selectorText) continue; if (styleSheet.rules[ri].selectorText.match(':hover')) { stylesheet.deleteRule(ri); } } } } catch (ex) {} } $(window).on('scroll', checkAnchors); $('.main-nav, .mobile-nav').on('click','div',navClick); $('body').on('click', '.rsvp', function () { // }); $('.schedule-info').on('click', function () { if ($('div', this).hasClass('active')) { $('div', this).removeClass('active'); } else { $('div', this).addClass('active'); } }); $('.answer-open').on('click', function () { if ($(this).hasClass('active')) { $(this).removeClass('active'); var answerParent = $(this).parent(); $('.faq-answer', answerParent).removeClass('active'); } else { $(this).addClass('active'); var answerParent = $(this).parent(); $('.faq-answer', answerParent).addClass('active'); } }); $('.mobile-menu-link').on('click', function (e) { e.preventDefault(); if ($('.mobile-nav').hasClass('active')) { $('.mobile-nav').removeClass('active'); $('.mobile-nav-cover').removeClass('active'); } else { $('.mobile-nav').addClass('active'); $('.mobile-nav-cover').addClass('active'); } }); $('.rewards-link').on('click', function (e) { e.preventDefault(); $('.rewards-pop-up').addClass('active'); $('.cover').addClass('active'); }); $('.rewards-pop-up-close-btn').on('click', function () { $('.rewards-pop-up').removeClass('active'); $('.cover').removeClass('active'); }); $('.trailer-house').magnificPopup({ delegate: 'i', // child items selector, by clicking on it popup will open type: 'iframe', gallery: { enabled:true } // other options }); $('.travel-info-image').magnificPopup({ delegate: 'img', // child items selector, by clicking on it popup will open type: 'image', gallery: { enabled:false } // other options }); //if (touch == false) { // $('.digital-link').on('mouseenter', function (e) // { // var currentSource = $('img', this).attr('src'); // var newSource = currentSource.replace('.png', '_hover.png'); // $('img', this).attr('src', newSource); // }); // $('.digital-link').on('mouseleave', function (e) // { // var currentSource = $('img', this).attr('src'); // var newSource = currentSource.replace('_hover.png', '.png'); // $('img', this).attr('src', newSource); // }); //} $('.digital-link').on('click', function (e) { e.preventDefault(); if ($(this).attr('href').search('playstation.com') != -1) { var storeLink = 'PlayStation Store'; } else if ($(this).attr('href').search('xbox.com') != -1) { var storeLink = 'Xbox Store'; } else if ($(this).attr('href').search('steampowered.com') != -1) { var storeLink = 'Steam Store'; } else if ($(this).attr('href').search('square') != -1) { var storeLink = 'Square Enix Store'; } if ($(this).hasClass('windows-10')) { // } else { ga('send', 'event', 'Store Link Click', storeLink); var url = window.location; var urlExtension = parseUrl(url).search; window.open($(this).attr('href')+urlExtension); } }); var language = $('body').attr('data-attr-lang'); $("#timer").countdown({ date: "february 5, 2016 16:00", yearsAndMonths: false, template: '<span class="time-text">%td</span> %d <span class="time-text">%th</span> <span class="time-text-2">%h</span> <span class="time-text">%ti</span> <span class="time-text-2">%i</span> <span class="time-text">%ts</span> <span class="time-text-2">%s</span>', }); $("#timer").countdown("changeLocale", language); var currentFlag; $('.flag-inner a').each(function () { if ($(this).attr('data-country-code') == language) { currentFlag = $(this).detach(); } }); $('.flag-container .flag-inner').prepend(currentFlag); $('.flag-container .flag-inner').on('click', 'div.flag', function () { var newLocale = ($(this).attr('id')).replace('-flag', ''); var newUrl = (window.location.href).split('/'); newUrl = newUrl[0] + '//' + newUrl[2] + '/'; window.location.href = newUrl+newLocale; }); if (typeof xboxRetailersArray !== 'undefined') { var parsedXbox = $.parseJSON(xboxRetailersArray); $.each(parsedXbox, function () { $('.linksHouse.retailers.xbox').append('<a href="'+this.link[0]+'" class="retailer-link" />'); $('.linksHouse.retailers.xbox a:last').append('<img src="'+this.logo+'" class="retailer-logo" />'); }); } if (typeof ps4RetailersArray !== 'undefined') { var parsedPS4 = $.parseJSON(ps4RetailersArray); $.each(parsedPS4, function () { $('.linksHouse.retailers.ps4').append('<a href="'+this.link[0]+'" class="retailer-link" />'); $('.linksHouse.retailers.ps4 a:last').append('<img src="'+this.logo+'" class="retailer-logo" />'); }); } if (typeof pcRetailersArray !== 'undefined') { var parsedPC = $.parseJSON(pcRetailersArray); $.each(parsedPC, function () { $('.linksHouse.retailers.pc').append('<a href="'+this.link[0]+'" class="retailer-link" />'); $('.linksHouse.retailers.pc a:last').append('<img src="'+this.logo+'" class="retailer-logo" />'); }); } }) (); function is_touch_device() { return 'ontouchstart' in window // works on most browsers || 'onmsgesturechange' in window; // works on ie10 } function parseUrl( url ) { var a = document.createElement('a'); a.href = url; return a; } function navClick (e) { e.preventDefault(); $(window).off('scroll', checkAnchors); $('.mobile-nav').removeClass('active'); $('.mobile-nav-cover').removeClass('active'); if ($(this).hasClass('active')) { // } else { $('.nav-item, .mobile-nav-item').each(function () { $(this).removeClass('active'); }); $(this).addClass('active'); if ($(this).attr('id') == 'forums') { window.location = 'http://forum.finalfantasyxv.com'; } else { //calculate destination place var dest = 0; if ($(window).width() <= 1024) { console.log('little screen'); if ($('a[href=#'+$(this).attr('id')+']').offset().top - $(window).height() * -.15 > $(document).height() - $(window).height()) { dest = $(document).height() - $(window).height(); } else { dest = $('a[href=#'+$(this).attr('id')+']').offset().top - $(window).height() * -.15; } } else { if ($('a[href=#'+$(this).attr('id')+']').offset().top - $(window).height() * .25 > $(document).height() - $(window).height()) { dest = $(document).height() - $(window).height(); } else { dest = $('a[href=#'+$(this).attr('id')+']').offset().top - $(window).height() * .25; } } //go to destination $('html,body').animate({ scrollTop: dest }, 500, 'swing', function () { $(window).on('scroll', checkAnchors); }); } } } function checkAnchors () { //var homeLoc = ($('a[href=#home]').offset().top) - ($(window).height() * .3); //var whatLoc = $('a[href=#what]').offset().top - ($(window).height() * .3); //var trailerLoc = $('a[href=#trailer]').offset().top - ($(window).height() * .3); //var livestreamLoc = $('a[href=#livestream]').offset().top - ($(window).height() * .3); //var scheduleLoc = $('a[href=#schedule]').offset().top - ($(window).height() * .3); //var travelLoc = $('a[href=#travel]').offset().top - ($(window).height() * .3); //var faqLoc = $('a[href=#faq]').offset().top - ($(window).height() * .3); // //if ( $(window).scrollTop() > homeLoc && $(window).scrollTop() < whatLoc) //{ // $('.nav-item, .mobile-nav-item').each(function () // { // $(this).removeClass('active'); // }); // $('.main-nav div[id=home], .mobile-nav div[id=home]').addClass('active'); //} //if ( $(window).scrollTop() > whatLoc && $(window).scrollTop() < trailerLoc) //{ // $('.nav-item, .mobile-nav-item').each(function () // { // $(this).removeClass('active'); // }); // $('.main-nav div[id=what], .mobile-nav div[id=what]').addClass('active'); //} //if ( $(window).scrollTop() > trailerLoc && $(window).scrollTop() < livestreamLoc) //{ // $('.nav-item, .mobile-nav-item').each(function () // { // $(this).removeClass('active'); // }); // $('.main-nav div[id=trailer], .mobile-nav div[id=trailer]').addClass('active'); //} //if ( $(window).scrollTop() > livestreamLoc && $(window).scrollTop() < scheduleLoc) //{ // $('.nav-item, .mobile-nav-item').each(function () // { // $(this).removeClass('active'); // }); // $('.main-nav div[id=livestream], .mobile-nav div[id=livestream]').addClass('active'); //} //if ( $(window).scrollTop() > scheduleLoc && $(window).scrollTop() < travelLoc) //{ // $('.nav-item, .mobile-nav-item').each(function () // { // $(this).removeClass('active'); // }); // $('.main-nav div[id=schedule], .mobile-nav div[id=schedule]').addClass('active'); //} //if ( $(window).scrollTop() > travelLoc && $(window).scrollTop() < faqLoc) //{ // $('.nav-item, .mobile-nav-item').each(function () // { // $(this).removeClass('active'); // }); // $('.main-nav div[id=travel], .mobile-nav div[id=travel]').addClass('active'); //} //if ( $(window).scrollTop() > faqLoc) //{ // $('.nav-item, .mobile-nav-item').each(function () // { // $(this).removeClass('active'); // }); // $('.main-nav div[id=faq], .mobile-nav div[id=faq]').addClass('active'); //} }
尋找差異