#slider {
.images {
display: flex;
}
}
jQuery 2026.4.13
jQuery 2026.4.13
#slider {
.images {
display: flex;
}
}
Javascript 2025.11.7
function imgAddClass(imgArr){
if(imgArr.length > 0){
for (let i = 0; i < imgArr.length; i++) {
var e = imgArr[i];
var width = e.naturalWidth;
var height = e.naturalHeight;
if(width < height){
e.classList.add('tate');
}else{
e.classList.add('yoko');
}
}
}
}
//判定したい要素を指定
var imgs = document.querySelectorAll('.image');
window.addEventListener('load', function(){
imgAddClass(imgs);
});
フォント 2025.10.22
<?php
$count = count(get_field(‘fieldname’));
?>
CSS 2025.7.17
.scroll {
overflow: auto;
&::-webkit-scrollbar {
width: 3px;
}
&::-webkit-scrollbar-track {
background-color: #f0f0f0;
}
&::-webkit-scrollbar-thumb {
background-color: #999;
border-radius: 0;
}
}
WordPress 2025.7.10
WP_Queryでカテゴリ絞り込みを使うと効かない模様
以下のように「’ignore_sticky_posts’ => false」を付けるとうまくいきます。
$args = array(
'post_type' => 'post', // 投稿タイプ
'posts_per_page' => 10, // 表示件数
'ignore_sticky_posts' => false, // 先頭固定表示を有効にする
);
$the_query = new WP_Query( $args );
if ( $the_query->have_posts() ) {
while ( $the_query->have_posts() ) {
$the_query->the_post();
?>
<--- 記事の表示 -->
<?php
}
wp_reset_postdata();
} else {
// 記事が見つからない場合の処理
}
.slick-slider div {
transition: none;
}
.slick-slide {
-webkit-backface-visibility: hidden;
-webkit-transform-style: preserve-3d;
}
CSS 2025.5.23
background: linear-gradient(transparent 60%, #63A0DA 0%);
display: inline;
padding: 5px;
box-decoration-break: clone;
-webkit-box-decoration-break: clone;
jQuery 2025.4.2
.slick-slider {
visibility: hidden;
}
$(document).ready(function() {
$('.slider').on('init', function(event, slick) {
$('.slick-slider').css('visibility', 'visible');
}).slick({
autoplay: true,
});
});
<section class="scroll">
<div class="first">
テキスト1 テキスト2 テキスト3 テキスト4 テキスト5
</div>
<div class="last">
テキスト1 テキスト2 テキスト3 テキスト4 テキスト5
</div>
</section>
.scroll {
display: flex;
overflow: hidden;
}
.scroll .first,
.scroll .last {
flex-shrink: 0;
width: auto;
height: auto;
display: inline-block;
text-wrap: nowrap;
white-space: nowrap;
}
.scroll .first {
animation: ani-first 10s infinite linear 0.1s both;
}
.scroll .last {
animation: ani-last 10s infinite linear 0.1s both;
}
@keyframes ani-first {
0% {
transform: translateX(0%);
}
100% {
transform: translateX(-100%);
}
}
@keyframes ani-last {
0% {
transform: translateX(0%);
}
100% {
transform: translateX(-100%);
}
}