|
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17 System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64 User : nobody ( 99) PHP Version : 5.2.17 Disable Function : NONE Directory : /home/queenjbs/www/test/look/ |
Upload File : |
$(function(){
var $nav = $('#nav').find('a');
var now = null;
var href = document.location.href;
$nav
.on({
mouseenter: function(){
if(now != $(this).attr('title')){
$(this).find('span').stop().animate({width:'100%'}, 400, 'easeOutCubic');
}
},
mouseleave: function(){
if(now != $(this).attr('title')){
$(this).find('span').stop().animate({width:0}, 300, 'easeOutCubic');
}
}
})
.find('span').css('width','0');
if(/profile/.test(href)){
now = 'PROFILE'
$nav.eq(1).find('span').css('width','100%');
}
else if(/album/.test(href)){
now = 'ALBUM'
$nav.eq(2).find('span').css('width','100%');
}
else if(/video/.test(href)){
now = 'VIDEO'
$nav.eq(3).find('span').css('width','100%');
}
else if(/gallery/.test(href)){
now = 'GALLERY'
$nav.eq(4).find('span').css('width','100%');
}
else if(/news/.test(href)){
now = 'NEWS/NOTICE'
$nav.eq(5).find('span').css('width','100%');
}
else if(/notice/.test(href)){
now = 'NEWS/NOTICE'
$nav.eq(5).find('span').css('width','100%');
}
else if(/schedule/.test(href)){
now = 'SCHEDULE'
$nav.eq(6).find('span').css('width','100%');
}
var $newsletter = $('#footer').find('input');
$newsletter.eq(1).on('click', function(){
$.ajax({
type: 'POST',
url: '/pages/bbs/mailing.php',
data: {
'address': ($newsletter.eq(0).val())
},
cache: false,
async: false,
success: function(result) {
var msg = '';
switch(result) {
case '110' : msg = '메일주소를 입력해주세요.'; break;
case '120' : msg = '올바른 이메일 형식이 아닙니다.'; break;
case '130' : msg = '이미 등록된 메일주소 입니다.'; break;
case '000' : msg = '등록되었습니다. 감사합니다.'; break;
}
alert(msg);
$newsletter.eq(0).val('')
}
});
});
});
/*profile*/
function Profile(init_index){ this.init(init_index) };
Profile.prototype = {
init: function(init_index){
this.$wrap = $('#content');
this.$nav = this.$wrap.find('.nav').find('a').css('opacity',0);
this.$nav_now = this.$nav.eq(init_index).css('opacity',1);
this.$profile_nav = this.$wrap.find('.profile-nav').find('a');
this.$profile_nav_now = this.$profile_nav.eq(0);
this.$profile_wrap = this.$wrap.find('.profile');
this.$profile = this.$profile_wrap.find('p').eq(0).show().end();
this.bindEvent();
},
bindEvent: function(){
var self = this;
this.$profile_nav
.css('opacity','0')
.on('click',function(){
if(self.$profile_nav_now != null){
self.$profile_nav_now.css('opacity',0);
}
self.$profile_nav_now = $(this).animate({opacity:1},200);
var index = parseInt(self.$profile_nav_now.attr('class').replace('nav',''))-1;
self.$profile_wrap.animate({opacity:0},150,function(){ self.$profile.hide().eq(index).show(),$(this).animate({opacity:1},200) });
}
).eq(0).css('opacity','1');
this.$nav
.on({
mouseenter: function(){
if(self.$nav_now.attr('class') !== $(this).attr('class')){
$(this).stop().animate({opacity:1},200);
}
},
mouseleave: function(){
if(self.$nav_now.attr('class') !== $(this).attr('class')){
$(this).stop().animate({opacity:0},200);
}
}
})
}
};
/*video*/
function Video(){ this.init() };
Video.prototype = {
init: function(){
this.$wrap = $('#content');
this.$youtube = this.$wrap.find('.youtube');
this.$list = this.$wrap.find('.list').find('a');
this.$list_wrap = this.$wrap.find('.list').find('ul');
this.$list_now = this.$list.eq(0);
this.$nav = this.$wrap.find('.nav');
this.tmpl = '<object width="964" height="538"><param name="movie" value="http://www.youtube.com/v/####?version=3&autohide=1&hl=ko_KR&autoplay=1"><param name="allowFullScreen" value="true"><param name="allowscriptaccess" value="always"><embed src="http://www.youtube.com/v/####?version=3&autohide=1&hl=ko_KR&autoplay=1" type="application/x-shockwave-flash" width="964" height="538" allowscriptaccess="always" allowfullscreen="true" wmode="transparent"></object>';
this.now = 0;
this.page = 0;
this.total = Math.ceil(this.$list.length/4)-1;
this.bindEvent();
},
bindEvent: function(){
var self = this;
this.$list.on({
mouseenter: function(){
if(self.$list_now.attr('title') !== $(this).attr('title')){
$(this)
.find('span').stop().animate({opacity:1},200).end()
.find('img').stop().animate({opacity:1},200);
}
},
mouseleave: function(){
if(self.$list_now.attr('title') !== $(this).attr('title')){
$(this)
.find('span').stop().animate({opacity:0},200).end()
.find('img').stop().animate({opacity:1},200);
}
},
click: function(){
if(self.$list_now.attr('title') !== $(this).attr('title')){
self.$list_now
.find('span').stop().animate({opacity:0},200).end()
.find('img').stop().animate({opacity:1},200);
self.$list_now = $(this)
.find('span').stop().animate({opacity:1},200).end()
.find('img').stop().animate({opacity:1},200).end();
self.$youtube.html(self.tmpl.replace(/####/g, $(this).attr('id')));
}
}
})
.find('span').css('opacity','0').end()
.eq(0).trigger('click').find('span').css({'opacity':'1'});
this.$nav.find('span').css('opacity','0').end()
.eq(0).css('background-position', '0 -64px')
.on({
mouseenter: function(){
if(self.page != 0){
$(this).find('span').stop().animate({opacity:1},200);
}
},
mouseleave: function(){
if(self.page != 0){
$(this).find('span').stop().animate({opacity:0},200);
}
},
click: function(){
if(self.page != 0){
self.page--;
if(self.page == 0){
$(this).css('background-position','0 -64px').find('span').css('opacity','0');
}
else if(self.page == self.total-1){
self.$nav.eq(1).css('background-position','0 0');
}
self.setPage();
}
}
}).end()
.eq(1)
.on({
mouseenter: function(){
if(self.page < self.total){
$(this).find('span').stop().animate({opacity:1},200);
}
},
mouseleave: function(){
if(self.page < self.total){
$(this).find('span').stop().animate({opacity:0},200);
}
},
click: function(){
if(self.page < self.total){
self.page++;
if(self.page == self.total){
$(this).css('background-position','0 -64px').find('span').css('opacity','0');
}
else if(self.page == 1){
self.$nav.eq(0).css('background-position','0 0');
}
self.setPage();
}
}
})
},
setPage: function(){
this.$list_wrap.animate({left:-972*this.page}, 500, 'easeInOutCubic');
}
};
/*video*/
function Gallery(){ this.init() };
Gallery.prototype = {
init: function(){
this.$wrap = $('#content');
this.$viewport = this.$wrap.find('.viewport');
this.$imgs = this.$viewport.find('img');
this.$list_wrap = this.$wrap.find('.list').find('ul');
this.$list = this.$wrap.find('.list').find('a');
this.$nav = this.$wrap.find('.nav');
this.now = 0;
this.page = 0;
this.total = Math.ceil(this.$imgs.length/4)-1;
this.bindEvent();
},
bindEvent: function(){
var self = this;
this.$list
.on({
mouseenter: function(){
var index = parseInt($(this).attr('index'))-1;
if(self.now !== index){
$(this)
.find('span').stop().animate({opacity:1},200).end()
.find('img').stop().animate({opacity:1},200);
}
},
mouseleave: function(){
var index = parseInt($(this).attr('index'))-1;
if(self.now !== index){
$(this)
.find('span').stop().animate({opacity:0},200).end()
.find('img').stop().animate({opacity:1},200);
}
},
click: function(){
var index = parseInt($(this).attr('index'))-1;
if(self.now !== index){
self.$list.eq(self.now)
.find('span').stop().animate({opacity:0},200).end()
.find('img').stop().animate({opacity:1},200);
$(this)
.find('span').stop().animate({opacity:1},200).end()
.find('img').stop().animate({opacity:1},200);
self.now = index;
self.$viewport.animate({opacity:0}, 200, 'easeInCubic', function(){
self.$imgs.hide().eq(self.now).show();
$(this).animate({opacity:1}, 800, 'easeOutCubic');
});
}
}
})
.find('span').css('opacity','0').end()
.eq(this.now).trigger('click').find('span').css({'opacity':'1'});
this.$nav
.find('span').css('opacity','0').end()
.eq(0)
.css('background-position', '0 -64px')
.on({
mouseenter: function(){
if(self.page != 0){
$(this).find('span').stop().animate({opacity:1},200);
}
},
mouseleave: function(){
if(self.page != 0){
$(this).find('span').stop().animate({opacity:0},200);
}
},
click: function(){
if(self.page != 0){
self.page--;
if(self.page == 0){
$(this).css('background-position','0 -64px').find('span').css('opacity','0');
}
else if(self.page == self.total-1){
self.$nav.eq(1).css('background-position','0 0');
}
self.setPage();
}
}
}).end()
.eq(1)
.on({
mouseenter: function(){
if(self.page < self.total){
$(this).find('span').stop().animate({opacity:1},200);
}
},
mouseleave: function(){
if(self.page < self.total){
$(this).find('span').stop().animate({opacity:0},200);
}
},
click: function(){
if(self.page < self.total){
self.page++;
if(self.page == self.total){
$(this).css('background-position','0 -64px').find('span').css('opacity','0');
}
else if(self.page == 1){
self.$nav.eq(0).css('background-position','0 0');
}
self.setPage();
}
}
})
},
setPage: function(){
this.$list_wrap.animate({left:-972*this.page}, 500, 'easeInOutCubic');
}
};
/*board*/
function Board(tbl,is_resize){ this.init(tbl,is_resize) };
Board.prototype = {
init: function(tbl,is_resize){
var eq = 0;
if(/notice/.test(document.location.href)){
eq = 1;
}
this.$wrap = $('#content');
this.$nav = this.$wrap.find('.nav').find('a').css('opacity',0);
this.$nav_now = this.$nav.eq(eq).css('opacity',1);
this.$list = this.$wrap.find('.list').find('.row');
this.open_now = null;
this.tbl = tbl;
this.bindEvent();
this.is_resize = is_resize;
},
bindEvent: function(){
var self = this;
this.$nav
.on({
mouseenter: function(){
if(self.$nav_now.attr('class') !== $(this).attr('class')){
$(this).stop().animate({opacity:1},200);
}
},
mouseleave: function(){
if(self.$nav_now.attr('class') !== $(this).attr('class')){
$(this).stop().animate({opacity:0},200);
}
}
})
this.$list
.on({
mouseenter: function(){
if(self.open_now != $(this).attr('index')){
$(this).css('background-color', '#ffffff');
}
},
mouseleave: function(){
if(self.open_now != $(this).attr('index')){
$(this).css('background-color', '#eef9fb');
}
},
click: function(){
if(self.open_now != $(this).attr('index')){
self.$list.eq(parseInt(self.open_now)).css('background-color', '#eef9fb').find('.msg').hide();
var $msg = $(this).find('.msg');
var _size = $msg.attr('size');
var _height = (_size) ? parseInt(_size) : $msg.innerHeight()-50;
$msg.attr('size', _height);
$(this).css('background-color', '#ffffff').find('.msg').show();
self.open_now = $(this).attr('index');
// hit
$.post('/pages/bbs/external_hit.php', {'bo_table':self.tbl, 'wr_id':$(this).attr('wr_id')});
if(self.is_resize){
$('#board-notice', parent.document).height(self.$wrap.find('.wrap').height());
}
}
else{
}
}
})
.find('.summary')
.on('click', function(event){
if(self.open_now == $(this).parent().attr('index')){
self.$list.eq(parseInt(self.open_now)).css('background-color', '#eef9fb').find('.msg').hide();
self.open_now = null;
event.stopImmediatePropagation();
event.stopPropagation();
if(self.is_resize){
$('#board-notice', parent.document).height(self.$wrap.find('.wrap').height());
}
}
});
}
};