Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // app.js
- var slide = $("header > img");
- var sno = 0;
- var eno = slide.length - 1;
- $("header").on("click",function(){
- $( slide[sno] ).animate({
- left: "940px"
- },1000,function(){
- $(this).css({left:"-940px"});
- });
- sno++;
- if( sno > eno ) sno = 0;
- $( slide[sno] ).animate({
- left: "0"
- },1000);
- });
- var timer = setInterval(function(){
- $("header").click();//trigger
- },2000);
- $("nav > ul > li").hover(
- function(){
- $(this).children("ul").slideDown();
- },
- function(){
- $(this).children("ul").slideUp("fast");
- }
- );
- $(".topic img").on("click",function(e){
- $("#popup").hide();
- // 화면 한가운데 위치 조정
- // var wh = $(window).height() / 2;
- // var ww = $(window).width() / 2;
- // var x = ww - 250;
- // var y = wh - 250;
- // 마우스 포인터 위치
- var x = e.pageX - 250;
- var y = e.pageY - 250;
- $("#popup").css({left:x+"px",top:y+"px"});
- var src = $(this).attr("src");
- var img = "<img src='" + src + "' width='500' height='500'>";
- $("#popup").html(img);
- $("#popup").show("slow");
- });
- $("#popup").on("click",function(){
- $(this).hide("slow");
- });
Advertisement
Add Comment
Please, Sign In to add comment