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'); //} }
查找差异