windowサイズが小さかったら<h3>を画像に切り替え
更にその下の<ul>を非表示→<h3>をクリックすると表示させたいのですが
動きません・・・。
まだ初心者なもので初歩的な所が間違っていると思うのですが
どなたか助けてください( ノД`)
#pdcaは、各#P,#D,#C,#Aが入っているdivです。
var windowWidth = $(window).width();
var windowSm = 767;
$(function(){
if (windowWidth <= windowSm) {
$(function(){
$("#P h3").html('<h3><img src="images/p_sp.png"></h3>');
$("#D h3").html('<h3><img src="images/d_sp.png"></h3>');
$("#C h3").html('<h3><img src="images/c_sp.png"></h3>');
$("#A h3").html('<h3><img src="images/a_sp.png"></h3>');
$('#pdca h3').click(function(){
$(this).next().slideToggle();
});
});
}
}
});
発生している問題・エラーメッセージ
Could not create SImpleDOM structure mostly cause of malformed HTML