Commit fbe23a4a by Orine Matsui

【テーマ】調整済み

parent fba13719
Showing with 77 additions and 0 deletions
<?php <?php
////////////////////////////////////////////////// //////////////////////////////////////////////////
//下記ユーザーカスタマイズエリア //下記ユーザーカスタマイズエリア
////////////////////////////////////////////////// //////////////////////////////////////////////////
window.WebFontConfig = {
google: {
families: ['Lato:100,300,400,700,900', 'Fjalla+One']
},
active: function () {
sessionStorage.fonts = true;
}
};
(function () {
var wf = document.createElement('script');
wf.src = 'https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js';
wf.type = 'text/javascript';
wf.async = 'true';
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(wf, s);
})();
$(function () {
var $setElm = $('.phrase-secondary');
var cutFigure = '118'; // カットする文字数
var afterTxt = '...'; // 文字カット後に表示するテキスト
$setElm.each(function () {
var textLength = $(this).text().length;
var textTrim = $(this).text().substr(0, (cutFigure))
if (cutFigure < textLength) {
$(this).html(textTrim + afterTxt).css({
visibility: 'visible'
});
} else if (cutFigure >= textLength) {
$(this).css({
visibility: 'visible'
});
}
});
var mvImgs = $(".swiper-imageSP");
for (var i = 0; i < mvImgs.length; i++) {
$(mvImgs[i]).css('background-image', $(mvImgs[i]).css('background-image').replace('.jpg', '_sp.jpg'));
}
var orig = document.referrer;
var desti = location.href;
if (orig.indexOf("featured") > -1) {
if (desti.match(/\/archives\/[0-9]{3,}/) !== null) {
var breds = $(".breadcrumb__list").children("li");
$(breds[1]).children("a").attr("href", "/featured");
$(breds[1]).children("a").text("特集一覧");
$(".current-post-ancestor").removeClass("current-post-ancestor").removeClass("current-menu-parent").removeClass("current-post-parent");
}
} else if (desti.match(/table-of-contents-2/) !== null) {
var breds = $(".breadcrumb__list").children("li");
$(breds[1]).css("display", "none");
$(breds[2]).css("display", "none");
} else if (desti.match(/table-of-contents/) !== null) {
var breds = $(".breadcrumb__list").children("li");
$(breds[1]).css("display", "none");
$(breds[2]).css("display", "none");
} else if (desti.match(/\/archives\/custom\/contents2-/) !== null) {
var breds = $(".breadcrumb__list").children("li");
$(breds[1]).css("display", "none");
$(breds[3]).css("display", "none");
$(breds[2]).children("a").attr("href", "/archives/custom/table-of-contents-2");
$(breds[2]).children("a").text("世界的心臓外科医 直伝!南先生の健康コラム");
} else if (desti.match(/\/archives\/custom\/contents1-/) !== null) {
var breds = $(".breadcrumb__list").children("li");
$(breds[1]).css("display", "none");
$(breds[2]).css("display", "none");
}
});
window.WebFontConfig={google:{families:["Lato:100,300,400,700,900","Fjalla+One"]},active:function(){sessionStorage.fonts=!0}},function(){var e=document.createElement("script");e.src="https://ajax.googleapis.com/ajax/libs/webfont/1.6.26/webfont.js",e.type="text/javascript",e.async="true";var s=document.getElementsByTagName("script")[0];s.parentNode.insertBefore(e,s)}(),$(function(){var e=$(".phrase-secondary"),s="118",t="...";e.each(function(){var e=$(this).text().length,a=$(this).text().substr(0,s);e>s?$(this).html(a+t).css({visibility:"visible"}):s>=e&&$(this).css({visibility:"visible"})});for(var a=$(".swiper-imageSP"),r=0;r<a.length;r++)$(a[r]).css("background-image",$(a[r]).css("background-image").replace(".jpg","_sp.jpg"));var n=document.referrer,i=location.href;if(n.indexOf("featured")>-1){if(null!==i.match(/\/archives\/[0-9]{3,}/)){var c=$(".breadcrumb__list").children("li");$(c[1]).children("a").attr("href","/featured"),$(c[1]).children("a").text("特集一覧"),$(".current-post-ancestor").removeClass("current-post-ancestor").removeClass("current-menu-parent").removeClass("current-post-parent")}}else if(null!==i.match(/table-of-contents-2/)){var c=$(".breadcrumb__list").children("li");$(c[1]).css("display","none"),$(c[2]).css("display","none")}else if(null!==i.match(/table-of-contents/)){var c=$(".breadcrumb__list").children("li");$(c[1]).css("display","none"),$(c[2]).css("display","none")}else if(null!==i.match(/\/archives\/custom\/contents2-/)){var c=$(".breadcrumb__list").children("li");$(c[1]).css("display","none"),$(c[3]).css("display","none"),$(c[2]).children("a").attr("href","/archives/custom/table-of-contents-2"),$(c[2]).children("a").text("世界的心臓外科医 直伝!南先生の健康コラム")}else if(null!==i.match(/\/archives\/custom\/contents1-/)){var c=$(".breadcrumb__list").children("li");$(c[1]).css("display","none"),$(c[2]).css("display","none")}});
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment