Diff
checker
テキスト
テキスト
画像
ドキュメント
Excel
フォルダ
Legal
Enterprise
デスクトップ
料金
ログイン
Diffchecker デスクトップのダウンロード
テキスト比較
2 つのテキスト ファイルの違いを見つける
ツール
履歴
ライブエディター
未変更行を折りたたむ
折り返しなし
レイアウト
分割
統合
比較精度
スマート
単語
文字
シンタックスハイライト
構文を選択
無視
テキスト変換
最初の差分へ移動
入力を編集
Diffchecker Desktop
Diffcheckerを実行する最も安全な方法。Diffchecker Desktopアプリを入手:あなたの差分はコンピューターから出ることはありません!
Desktopを入手
inside out project STEP-104 to STEP-105 JavaScript Code Changes
作成日
8 年前
差分は期限切れになりません
クリア
エクスポート
共有
説明
30 削除
行
合計
削除
文字
合計
削除
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
79 行
すべてコピー
33 追加
行
合計
追加
文字
合計
追加
この機能を引き続き使用するには、アップグレードしてください
Diff
checker
Pro
価格を見る
83 行
すべてコピー
コピー
コピー済み
コピー
コピー済み
//
JavaScript Document
//
inside out project STEP-105
window.onload = init();
window.onload = init();
function init() {
function init() {
window.addEventListener('scroll', function(e) {
window.addEventListener('scroll', function(e) {
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
var distanceY = window.pageYOffset || document.documentElement.scrollTop,
shrinkOn = 300,
shrinkOn = 300,
header = document.querySelector("header");
header = document.querySelector("header");
if (distanceY > shrinkOn) {
if (distanceY > shrinkOn) {
classie.add(header, "smaller");
classie.add(header, "smaller");
} else {
} else {
if (classie.has(header, "smaller")) {
if (classie.has(header, "smaller")) {
classie.remove(header, "smaller");
classie.remove(header, "smaller");
}
}
}
}
});
});
$.ajax({
$.ajax({
method: 'GET',
method: 'GET',
url: 'https://me.inside-out-project.com/wp-json/wp-api-menus/v2/menus/3',
url: 'https://me.inside-out-project.com/wp-json/wp-api-menus/v2/menus/3',
dataType: 'json',
dataType: 'json',
success: function(data) {
success: function(data) {
コピー
コピー済み
コピー
コピー済み
$('nav').hide();
$('nav').hide();
コピー
コピー済み
コピー
コピー済み
var menu = menuBuilder(data.items);
var menu = menuBuilder(data.items);
コピー
コピー済み
コピー
コピー済み
$('nav').html(menu).slideDown();
$('nav').html(menu).slideDown();
コピー
コピー済み
コピー
コピー済み
$('nav
li a
').
click(function() {
//
$('nav
').
append(menu
);
getPage($(this).data("pgid"));
}
);
getPage(314);
$("#loaderDiv").fadeOut("slow");
$("#loaderDiv").fadeOut("slow");
コピー
コピー済み
コピー
コピー済み
},
},
error: function() {
error: function() {
コピー
コピー済み
コピー
コピー済み
console.log('all is not good');
console.log('all is not good');
コピー
コピー済み
コピー
コピー済み
}
}
});
});
コピー
コピー済み
コピー
コピー済み
}
}
コピー
コピー済み
コピー
コピー済み
function menuBuilder(obj) {
function menuBuilder(obj) {
コピー
コピー済み
コピー
コピー済み
var theMenu = '';
var theMenu = '';
コピー
コピー済み
コピー
コピー済み
if (obj.length > 0) {
if (obj.length > 0) {
コピー
コピー済み
コピー
コピー済み
theMenu = theMenu + '<ul>';
theMenu = theMenu + '<ul>';
コピー
コピー済み
コピー
コピー済み
obj.forEach(function(item) {
obj.forEach(function(item) {
コピー
コピー済み
コピー
コピー済み
theMenu = theMenu + '<li><a href="#
" data-pgid="' + item.object_id + '
">' + item.title + '</a>';
theMenu = theMenu + '<li><a href="#
">' + item.title + '</a>';
if (item.children) {
if (item.children) {
コピー
コピー済み
コピー
コピー済み
theMenu = theMenu + menuBuilder(item.children);
theMenu = theMenu + menuBuilder(item.children);
コピー
コピー済み
コピー
コピー済み
}
}
コピー
コピー済み
コピー
コピー済み
theMenu = theMenu + '</li>';
theMenu = theMenu + '</li>';
コピー
コピー済み
コピー
コピー済み
});
});
コピー
コピー済み
コピー
コピー済み
theMenu = theMenu + '</ul>';
theMenu = theMenu + '</ul>';
コピー
コピー済み
コピー
コピー済み
} else {
} else {
コピー
コピー済み
コピー
コピー済み
console.log('no data');
console.log('no data');
コピー
コピー済み
コピー
コピー済み
}
}
コピー
コピー済み
コピー
コピー済み
return theMenu;
return theMenu;
}
}
コピー
コピー済み
コピー
コピー済み
function getPage(obj) {
$("#loaderDiv").fadeIn("slow");
$.ajax({
method: 'GET',
url: 'https://me.inside-out-project.com/wp-json/wp/v2/pages/' + obj,
dataType: 'json',
success: function(data) {
var pgbuild = '';
pgbuild = '<section><div class="container">' + data.content.rendered + '</div></section>';
$("#content").fadeOut(function() {
$('html').animate({
scrollTop: 0
}, 'slow'); //IE, FF
$('body').animate({
scrollTop: 0
}, 'slow'); //chrome, don't know if Safari works
$(this).html(pgbuild).fadeIn();
$("#loaderDiv").fadeOut("slow");
});
},
error: function() {
console.log('bad');
}
});
}
保存された差分
原文
ファイルを開く
// JavaScript Document window.onload = init(); function init() { window.addEventListener('scroll', function(e) { var distanceY = window.pageYOffset || document.documentElement.scrollTop, shrinkOn = 300, header = document.querySelector("header"); if (distanceY > shrinkOn) { classie.add(header, "smaller"); } else { if (classie.has(header, "smaller")) { classie.remove(header, "smaller"); } } }); $.ajax({ method: 'GET', url: 'https://me.inside-out-project.com/wp-json/wp-api-menus/v2/menus/3', dataType: 'json', success: function(data) { $('nav').hide(); var menu = menuBuilder(data.items); $('nav').html(menu).slideDown(); // $('nav').append(menu); $("#loaderDiv").fadeOut("slow"); }, error: function() { console.log('all is not good'); } }); } function menuBuilder(obj) { var theMenu = ''; if (obj.length > 0) { theMenu = theMenu + '<ul>'; obj.forEach(function(item) { theMenu = theMenu + '<li><a href="#">' + item.title + '</a>'; if (item.children) { theMenu = theMenu + menuBuilder(item.children); } theMenu = theMenu + '</li>'; }); theMenu = theMenu + '</ul>'; } else { console.log('no data'); } return theMenu; }
変更されたテキスト
ファイルを開く
// inside out project STEP-105 window.onload = init(); function init() { window.addEventListener('scroll', function(e) { var distanceY = window.pageYOffset || document.documentElement.scrollTop, shrinkOn = 300, header = document.querySelector("header"); if (distanceY > shrinkOn) { classie.add(header, "smaller"); } else { if (classie.has(header, "smaller")) { classie.remove(header, "smaller"); } } }); $.ajax({ method: 'GET', url: 'https://me.inside-out-project.com/wp-json/wp-api-menus/v2/menus/3', dataType: 'json', success: function(data) { $('nav').hide(); var menu = menuBuilder(data.items); $('nav').html(menu).slideDown(); $('nav li a').click(function() { getPage($(this).data("pgid")); }); getPage(314); $("#loaderDiv").fadeOut("slow"); }, error: function() { console.log('all is not good'); } }); } function menuBuilder(obj) { var theMenu = ''; if (obj.length > 0) { theMenu = theMenu + '<ul>'; obj.forEach(function(item) { theMenu = theMenu + '<li><a href="#" data-pgid="' + item.object_id + '">' + item.title + '</a>'; if (item.children) { theMenu = theMenu + menuBuilder(item.children); } theMenu = theMenu + '</li>'; }); theMenu = theMenu + '</ul>'; } else { console.log('no data'); } return theMenu; } function getPage(obj) { $("#loaderDiv").fadeIn("slow"); $.ajax({ method: 'GET', url: 'https://me.inside-out-project.com/wp-json/wp/v2/pages/' + obj, dataType: 'json', success: function(data) { var pgbuild = ''; pgbuild = '<section><div class="container">' + data.content.rendered + '</div></section>'; $("#content").fadeOut(function() { $('html').animate({ scrollTop: 0 }, 'slow'); //IE, FF $('body').animate({ scrollTop: 0 }, 'slow'); //chrome, don't know if Safari works $(this).html(pgbuild).fadeIn(); $("#loaderDiv").fadeOut("slow"); }); }, error: function() { console.log('bad'); } }); }
違いを見つける