ブラウザーの幅が 760 ピクセル以上で 980 ピクセル未満の場合、Div タグを空にしたいのですが、何か間違ったことをしているように見えます
(function($){
//detect the width on page load
$(document).ready(function(){
var current_width = $(window).width();
//do something with the width value here!
if(current_width < 980 && current_width > 760){
$('#chwd').empty();
}
});
//update the width value when the browser is resized (useful for devices which switch from portrait to landscape)
$(window).resize(function(){
var current_width = $(window).width();
//do something with the width value here!
if(current_width < 980 && current_width > 760 ){
$('#chwd').empty();
}
else{
$('#chwd').html(
<div id="ahead">
<div class="column">
Cash On Delivery
</div>
</div>
);}
});
})(jQuery);
どんな助けでも大歓迎です
ありがとう