Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: preg_replace(): Compilation failed: invalid range in character class at offset 4 in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php on line 340

Warning: Cannot modify header information - headers already sent by (output started at /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/all-in-one-seo-pack/app/Common/Meta/Robots.php on line 73

Warning: Cannot modify header information - headers already sent by (output started at /home/users/1/double04/web/manual-rank-quest.com/wp-content/plugins/crayon-syntax-highlighter/crayon_langs.class.php:340) in /home/users/1/double04/web/manual-rank-quest.com/wp-includes/feed-rss2.php on line 8
加瀬のメモ | ランクエストマニュアル https://manual-rank-quest.com Mon, 14 Mar 2022 11:05:17 +0000 ja hourly 1 https://wordpress.org/?v=6.9 JSで良い動きが出来た! https://manual-rank-quest.com/%e5%8a%a0%e7%80%ac%e3%81%ae%e3%83%a1%e3%83%a2/js%e3%81%a7%e8%89%af%e3%81%84%e5%8b%95%e3%81%8d%e3%81%8c%e5%87%ba%e6%9d%a5%e3%81%9f%ef%bc%81/ https://manual-rank-quest.com/%e5%8a%a0%e7%80%ac%e3%81%ae%e3%83%a1%e3%83%a2/js%e3%81%a7%e8%89%af%e3%81%84%e5%8b%95%e3%81%8d%e3%81%8c%e5%87%ba%e6%9d%a5%e3%81%9f%ef%bc%81/#respond Mon, 14 Mar 2022 11:05:17 +0000 https://manual-rank-quest.com/?p=778 参考コード HTML部分  <li class=“gnav__item nav_hover“><a class=“gnav__item__link“ href=“…

The post JSで良い動きが出来た! first appeared on ランクエストマニュアル.

]]>
参考コード

HTML部分 

<li class=gnav__item nav_hover><a class=gnav__item__link href=<?php echo home_url(); ?>/topics-all>トピックス</a>
                    <ul class=child_nav id=child_nav>
                        <li>お知らせ</li>
                        <li>イベント</li>
                        <li>リリース情報</li>
                        <li>製品情報</li>
                    </ul>
                </li>

 

CSS部分

/*グロナビ*/
.child_nav{
position: absolute;
font-size: 1.3rem;
background: #fff;
width:140px;
opacity:0;
}

.child_nav2{
position: absolute;
right:500px;
font-size: 1.3rem;
background: #fff;
width:140px;
opacity:0;
}

.child_nav li{
margin:0 auto;
width:55%;
display:none;
}

.child_nav2 li{
margin:0 auto;
width:55%;
}

.child_nav li:before{
content:”-“;
margin-right:5px;
color:#009044;
}

.child_nav2 li:before{
content:”-“;
margin-right:5px;
color:#009044;
}

JS部分

<scripttype=text/javascript>
$(function(){
$(.nav_hover).mouseenter(function(){
$(.child_nav).addClass(child_nav2);
$(.child_nav).removeClass(child_nav);
$(.child_nav2).css(opacity,1).css(transition,0.5s).animate({ right:400 }, 150);
$(.child_nav2 li).css(display,block);
$(.child_nav2).css(visibility,inherit);
        });
$(.nav_hover).mouseleave(function(){
$(.child_nav2).removeClass(child_nav2);
$(#child_nav).addClass(child_nav);
$(.child_nav).css(visibility,hidden);
$(.child_nav).css(opacity,0).css(transition,0.5s).animate({ right:500 }, 150);
        });
});
</script>

動きの説明

マウスを載せるor離す(mouseenter,mouseleave)の際に色々なcssの変更、クラス付与、削除を行っている。

その中で今回はアニメーションを使い、弱パララックスみたいな事をした。

position:absoluteで相対位置を作る。

元の位置を少し左に設定かつ非表示、ホバーした際に、表示したい場所に移動させることで、パララックスぽく設定!

 

The post JSで良い動きが出来た! first appeared on ランクエストマニュアル.

]]>
https://manual-rank-quest.com/%e5%8a%a0%e7%80%ac%e3%81%ae%e3%83%a1%e3%83%a2/js%e3%81%a7%e8%89%af%e3%81%84%e5%8b%95%e3%81%8d%e3%81%8c%e5%87%ba%e6%9d%a5%e3%81%9f%ef%bc%81/feed/ 0