링크를 클릭하면 사라지는 라이트 박스 기능을 만들려고합니다. 나는 그것을 한 번 실행할 수있다. 달리고 닫히면 다시 도망 칠 수 없습니까? 이상한 종류? 나는 무엇을 잘못 했는가?라이트 박스가있는 스크립트는 한 번만 실행됩니다.
내 스크립트를
<script>
$(document).ready(function() {
$('.button1').click(function() {
$('#aloe').fadeIn(600);
});
});
</script>
코드 :
<a class="button1"><img src="{{ 'aloevera.png' | asset_url }}" /></a>
<div id="aloe" style="display: none;"><div id="box1">
<div id="inner"><a class="exit" onclick='$("#box1").fadeOut(600, function() { $(this).remove(); });'>x</a>
</div>
<div class="outer">
<div class="middle">
<div class="inner">
<h1>Organic Aloe Vera Extract</h1>
Our organic Aloe Vera Extract is from Asia. The polysaccharides act as moisturizers and hydrate the skin.
Aloe vera is absorbed into the skin and stimulates the fibroblasts to replicate themselves faster and it
is these cells that produce the collagen and elastin fibers, so the skin becomes more elastic and less wrinkled.
</div>
</div>
</div>
</div></div>
는 $ ("#의 BOX1")'교체를 페이드 아웃 ((600), 기능() {$ (이) .remove() ;});'$ ("# aloe") .fadeOut (600);' –