20
December
ヘッダー固定でスクロールすると透過させるjs
$(document).ready(function() { $(window).scroll(function() { if ($(this).scrollTop() > 0) { $('header').css('opacity', 0.8); } else { $('header').css('opacity', 1); } }); });
PR
$(document).ready(function() { $(window).scroll(function() { if ($(this).scrollTop() > 0) { $('header').css('opacity', 0.8); } else { $('header').css('opacity', 1); } }); });
<img src="<?php echo get_template_directory_uri(); ?>/images/title_<?php echo esc_attr($post->post_name); ?>.jpg" alt="<?php the_title(); ?>" />
<script type="text/javascript"> var ua = navigator.userAgent; if(ua.indexOf('iPhone') != -1 || ua.indexOf('iPad') != -1 || ua.indexOf('Android') != -1){ //iPhone & iPad document.write('<link rel="stylesheet" href="style_ip.css">'); }else{ //PC document.write('<link rel="stylesheet" href="style_pc.css">'); } </script>