문제

I have a banner which need to be appear by explode effect in jquery.

html:

<div class="banner">
<div class="click-for-more">Click For More!</div>
</div>
<div class="mosaic">
<div class="close-btn">X</div>
<img src="1280x1024(image).jpg">
</div>

jquery:

 $(document).ready(function(){
$(".click-for-more").click(function(e){
        e.preventDefault();
         $('.mosaic').show("explode", { pieces: 64 }, 2000);
    });

$(".close-btn").click(function(){
         $('.mosaic').hide("explode", { pieces: 64 }, 2000); 
    });
});

however, the effect is not working but lagging before it appear. Why is it happened? am i doing anything wrong in the code?

도움이 되었습니까?

해결책

Try this out:- http://jsfiddle.net/adiioo7/RvCS6/

JS:-

$(".click-for-more").click(function(e){
        e.preventDefault();
        $('.mosaic').show("explode", { pieces: 64 }, 2000);
    });

$(".close-btn").click(function(){
        $('.mosaic').hide("explode", { pieces: 64 }, 2000); 
    });
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top