/* WordPress対応の強いセレクタ */
.wp-key-term {
display: inline !important;
text-decoration: none !important;
border: none !important;
outline: none !important;
padding: 0 !important;
margin: 0 !important;
} .wp-key-term.wp-hidden {
background: repeating-linear-gradient(
45deg,
#e8e8e8,
#e8e8e8 1px,
#d0d0d0 1px,
#d0d0d0 2px
) !important;
color: transparent !important;
text-shadow: none !important;
border: none !important;
position: relative !important;
box-shadow: none !important;
padding: 0 !important;
margin: 0 !important;
} .wp-key-term.wp-hidden:hover {
background: repeating-linear-gradient(
45deg,
#f0f0f0,
#f0f0f0 1px,
#d8d8d8 1px,
#d8d8d8 2px
) !important;
transform: scale(1.01) !important;
} #toggleBtn.wp-active {
background: #f44336 !important;
transform: scale(0.98) !important;
} document.addEventListener(‘DOMContentLoaded’, function() {
let globalHiddenState = false;
window.toggleKeyTerms = function() {
const keyTerms = document.querySelectorAll(‘.wp-key-term’);
const btn = document.getElementById(‘toggleBtn’);
globalHiddenState = !globalHiddenState;
if (globalHiddenState) {
keyTerms.forEach(function(term) {
term.classList.add(‘wp-hidden’);
term.dataset.individualState = ‘hidden’;
});
btn.textContent = ‘重要語句を表示’;
btn.classList.add(‘wp-active’);
} else {
keyTerms.forEach(function(term) {
term.classList.remove(‘wp-hidden’);
term.dataset.individualState = ‘visible’;
});
btn.textContent = ‘重要語句を隠す’;
btn.classList.remove(‘wp-active’);
}
};
const keyTerms = document.querySelectorAll(‘.wp-key-term’);
keyTerms.forEach(function(term) {
term.dataset.individualState = ‘visible’;
term.addEventListener(‘click’, function(e) {
e.preventDefault();
e.stopPropagation();
if (this.dataset.individualState === ‘visible’) {
this.classList.add(‘wp-hidden’);
this.dataset.individualState = ‘hidden’;
} else {
this.classList.remove(‘wp-hidden’);
this.dataset.individualState = ‘visible’;
}
});
term.addEventListener(‘mouseenter’, function() {
this.style.cursor = ‘pointer’;
});
});
});
代理商
Subscribe
Login
0 Comments
Oldest