스크립트 문의좀 드릴께요 ~
본문
안녕하세요
상단메뉴 소스인데요 지금은 아래 소스보면 index.php일때와 인덱스가 아닐때 보여지는게 다르게 되어 있는데요..
index.php , /html/0101_eng.php 이 2개 페이지에서만 같은 형식으로 보이게 하고 싶은데
어떻게 하면 될까요? 봐도 뭐가 뭔지 모르겠네요 ㅜㅜ
도와주세면 감사하겠습니다.
<script>
$(document).ready(function(){
var spliteFile = ""+document.location+"";
var arr = spliteFile.split("/");
var name = arr[arr.length-1];
var fName = name.split(".");
if (fName[0] != "" && fName[0] != "index"){ //메인이 아닌경우
var name2 = arr[arr.length-2];
if(name2 != "bbs"){ //메인도 아니고 게시판도 아닌경우 즉 순수 서브페이지
var bNum_t = fName[0].substring(0,2); //대메뉴 인덱스 값 추출
var bNum = ltrimzero(bNum_t);//소메뉴 인덱스 값 추출
var sNum_t = fName[0].substring(2,4);
var sNum = ltrimzero(sNum_t);//소메뉴 인덱스 값 추출
$(".msub_"+bNum+"_t").css("color","#6e2a8d"); // class="msub_1_t"
$(".msub_"+bNum+"_"+sNum).css("color","#6e2a8d"); // class="msub_1_1"
var bNumText = $(".msub_"+bNum+"_t").html();
var sNumText = $(".msub_"+bNum+"_"+sNum).html();
$("#bm_title").html(bNumText); // msub_1_t 지정 이름 가져오기 (메인타이틀)
$("#bm_title2").html(sNumText); // msub_1_1 지정 이름 가져오기 (서브타이틀)
$(".msub_"+bNum+"_t").css("background","url(/theme/basic/img/gnb_over_bg.jpg) no-repeat center bottom");
$("#subfile_img_content").attr("src","/img/"+fName[0]+".jpg"); //각 페이지 번호 이미지 가져오기
}
else{ //게시판,회원가입,로그인페이지등 그누보드 기반페이지 인경우
var seq = getParam("bo_table");
if(!seq || seq == ""){ //회원가입인경우
if ($("#container_title").html() == undefined || $("#container_title").html() == null){
$("#bm_title2").html("회원가입");
}
else{
$("#bm_title2").html($("#container_title").html());
}
}
else{ //순수 게시판 인경우
if (seq == "online_consult"){
var bNum = "6";
var sNum = "6";
}
else if (seq == "notice"){
var bNum = "6";
var sNum = "1";
}
else if (seq == "cure"){
var bNum = "6";
var sNum = "2";
}
else if (seq == "photo"){
var bNum = "6";
var sNum = "3";
}
else if (seq == "colum"){
var bNum = "6";
var sNum = "4";
}
else if (seq == "befe"){
var bNum = "6";
var sNum = "5";
}
else if (seq == "diary"){
var bNum = "6";
var sNum = "7";
}
//순수 게시판 인 경우 스크립트
$(".msub_"+bNum+"_t").css("color","#6e2a8d"); // class="msub_1_t"
$(".msub_"+bNum+"_"+sNum).css("color","#6e2a8d"); // class="msub_1_1"
var bNumText = $(".msub_"+bNum+"_t").html();
var sNumText = $(".msub_"+bNum+"_"+sNum).html();
$("#bm_title").html(bNumText); // msub_1_t 지정 이름 가져오기 (메인타이틀)
$("#bm_title2").html(sNumText); // msub_1_t 지정 이름 가져오기 (서브타이틀)
}
}
//서브 페이지 인경우
//서브 페이지 인경우 헤더슬라이드
$(".sub_inner").hide(); // 서브이너 내용을 숨겨 놓고
$(".gnb_section").find("#gnb_sub"+bNum).show(); // 서브이너 각각에 내용을 가져와서
$(".gnb_section").stop().show();
$('.header_bottom .gnb li').mouseenter(function(){ //마우스 오버했을때
var getNumArr = $(this).attr("class").split("_"); //// 서브이너 각각에 내용을 가져와서
$(".sub_inner").hide();
$(".gnb_section").find("#gnb_sub"+getNumArr[1]).show();
$(".gnb_section").stop().slideDown(300);
});
//서브 페이지 인경우 헤더 제자리 이동
$('.gnb_section').mouseleave(function(){
$(".sub_inner").hide();
$(".gnb_section").find("#gnb_sub"+bNum).show();
$(".gnb_section").stop().show();
});
$('#sub_hide').hide();
}
else{ //인덱스 페이지 인경우 헤더슬라이드
//메인메뉴 슬라이드
$('.header_bottom .gnb li').mouseenter(function(){
var getNumArr = $(this).attr("class").split("_");
$(".sub_inner").hide();
$(".gnb_section").find("#gnb_sub"+getNumArr[1]).show();
$(".gnb_section").slideDown(400);
});
$('.over_hide').mouseover(function(){
$(".sub_inner").hide();
$(".gnb_section").stop().slideUp(220);
});
$('.gnb_section').mouseleave(function(){
$(this).stop().slideUp(220);
});
$('.total_menu_btn').mouseenter(function(){
$(".gnb_section").slideUp(220);
});
$('.home_menu_btn').mouseenter(function(){
$(".gnb_section").slideUp(220);
})
//section1_inner_banner
$(".main .section1_inner .section1_inner_banner ul li a").hover(
function () {
$(this).children(".fe").css("display","block");
},
function () {
$(this).children(".fe").css("display","none");
$(this).children(".be").css("display","block");
}
);
//section1_inner_treatment 마우스올렷을떄 이미지변경 2
$('.main .section1_inner .section1_inner_treatment .treatment_box2 .treatment_box2_img img:gt(0)').hide(); //클릭시 화면 바꾸기
$('.main .section1_inner .section1_inner_treatment .treatment_box1 ul li').mouseenter(function(e){
e.preventDefault();
var num=$(this).index();
$('.main .section1_inner .section1_inner_treatment .treatment_box2 .treatment_box2_img img').hide();
$('.main .section1_inner .section1_inner_treatment .treatment_box2 .treatment_box2_img img').eq(num).show();
});
//section1_inner_treatment 마우스올렷을떄 이미지변경 3
$('.main .section1_inner .section1_inner_treatment .treatment_box2 .treatment_box2_img img:gt(0)').hide(); //클릭시 화면 바꾸기
$('.main .section1_inner .section1_inner_treatment .treatment_box3 ul li').mouseenter(function(e){
e.preventDefault();
var num=$(this).index();
$('.main .section1_inner .section1_inner_treatment .treatment_box2 .treatment_box2_img img').hide();
$('.main .section1_inner .section1_inner_treatment .treatment_box2 .treatment_box2_img img').eq(num + 6).show();
});
} //인덱스만인곳 끝!
//푸터 top버튼
$("#footer_info_upbtn").click(function() {
$('html, body').animate({
scrollTop : 0
}, 1500);
return false;
});
//토탈메뉴 on/off 스위치
$(".total_menu_btn").click(function(){
if($(this).hasClass("active")){
$(".total_menu").slideUp(830);
$(this).removeClass("active");
$(this).css("background","url(/theme/basic/img/total_menu_btn.jpg)");
}else{
$(".total_menu").slideDown(1000);
$(this).addClass("active");
$(this).css("background","url(/theme/basic/img/total_menu_btn_on.jpg)");
}
});
$(function() { //오시는길 모션
function swing() {
$('.footer .section1 .section2_banner2 .section2_banner2_position').animate({'bottom':'105px'},800).animate({'bottom':'111px'},800, swing);
}
swing();
});
//퀵메뉴
var quick_menu = $('#quick');
var quick_top = 180;
/* quick menu initialization */
quick_menu.css('top', $(window).height() );
$(document).ready(function(){
quick_menu.animate( { "top": $(document).scrollTop() + quick_top +"px" }, 0 );
$(window).scroll(function(){
quick_menu.stop();
quick_menu.animate( { "top": $(document).scrollTop() + quick_top + "px" }, 0 );
});
});
//푸터 자격증 슬라이드
window.setTimeout(function(){
imgStart("R");
},3000); // 페이지 열렸을때 머무는시간
});
function ltrimzero(str){
return str.replace(/(^0+)/, "");
}
function getParam(key){
var _parammap = {};
document.location.search.replace(/\??(?:([^=]+)=([^&]*)&?)/g, function () {
function decode(s) {
return decodeURIComponent(s.split("+").join(" "));
}
_parammap[decode(arguments[1])] = decode(arguments[2]);
});
return _parammap[key];
}
</script>