저혼자는 답이 안나와서 ㅜㅜ > 그누4 질문답변

그누4 질문답변

그누보드4 관련 질문은 QA 로 이전됩니다. QA 그누보드4 바로가기
기존 게시물은 열람만 가능합니다.

저혼자는 답이 안나와서 ㅜㅜ 정보

저혼자는 답이 안나와서 ㅜㅜ

본문

부득이하게 집에서 작업을 안하고 회사에서 짬짬히  몰래 작업하고 있습니다. 집에가면 자기가 바빠서 ...
지금 회사는 익스7 사용중입니다.

http://sir.co.kr/bbs/board.php?bo_table=g4_skin&wr_id=97514&page=3
홈이네 님이 만드신 무한텝메뉴 스킨인데요. 위 스킨을 가공하여 사용중인데 자꾸 1px 오차가 납니다.
이미지 보시면 아시겠지만, 4개의 메뉴를 사용중인데, 메뉴2번만 왼쪽에 1px 오차가 있습니다.
보이시죠?

이상하게 이 1px 짜리가 사람잡네요. 홈페이지 만들면서 각잡는건 버릇인것 같군요.
이놈 잡을려고 눈치 보면서 작업하는데 진도가 안나가네요. 들키면 큰일이기 땀시. ㅎㅎ
점심시간을 찬스로 글을 써봅니다.

링크랑 이미지 첨부합니다.

조언좀 주실분 ㅜㅜ

아참 스킨 제작자분 잘쓰고있습니다.

댓글 전체

<style type="text/css">
* {font-size:12px; font-family:dotum;} 
.bt1cc { border-top:1px solid #000; }
.bl1cc { border-left:1px solid #cccccc; }
.br1cc { border-right:1px solid #cccccc; }
.bb1cc { border-bottom:1px solid #cccccc; }
.bb1f5 { border-bottom:1px solid #f5f5f5; }
 
.slide-tab { border:1px solid #cccccc; overflow-x:hidden; position:relative; margin:10px 0 0 0; width:200px; z-index:10; }
.slide-tab-line { height:26px; position:relative; width:200px; z-index:10; }
#slide-tab-menu
{
    clear:both;
font-family:Dotum;
font-size:11px;
letter-spacing:-1px;
position:absolute;
white-space:nowrap;
z-index:20;
}
 
#slide-tab-menu a { display:inline-block; height:26px; line-height:26px; width: 50px; margin:0; }
#slide-tab-menu a.select { background-color:#f5f5f5; color:#000000; font-weight:bold; text-decoration:none; }
#slide-tab-menu a.noselect {  }
#slide-tab-content { background-color:#f5f5f5; clear:both; height:141px; }
#slide-tab-content div { display:none; height:100%; width:100%; }
</style>
 
<div class="slide-tab">
    <div id="slide-tab-menu"><a href="javascript:;" class='select bb1f5'>메뉴1</a><a href="javascript:;" class='noselect bl1cc'>메뉴2</a><a href="javascript:;" class='noselect bl1cc'>메뉴3</a><a href="javascript:;" class='noselect bl1cc'>메뉴4</a></div>
    <div class="slide-tab-line bb1cc"></div>
    <div id="slide-tab-content">        <div style="display:block;padding:10px 0 0 10px;text-align:left;">죄송합니다. 테스트에요</div>
        <div style="padding:10px 0 0 10px;text-align:left;">테스트 랑께요.</div>
        <div style="padding:10px 0 0 10px;text-align:left;">어허 이사람이 ..</div>
<div style="padding:10px 0 0 10px;text-align:left;">이양반이 안되겠구만</div>
</div>
</div>
 
<script type="text/javascript">
var tabs = document.getElementById("slide-tab-menu");
 
window.onload = function()
{
    tabs.func_onclick = function(e)
    {
        var e = e || window.event;
        var target = e.srcElement || e.target;
 
        if (target.nodeName.toUpperCase() == "A")
        {
            target.blur();
 
            if (target == this.target)
                return;
 
            if (this.target_obj != null)
                this.target_obj.className = "";
 
            this.target_obj = target;
 
            var childs = this.children;
 
            for (var i=0; i<childs.length; i++)
            {
                if (childs[0] == childs[i])
                {
                    if (target == childs[i])
                        childs[i].className = "select bb1f5";
                    else
                        childs[i].className = "noselect";
                }
                else if (childs[childs.length] == childs[i])
                {
                    if (target == childs[i])
                        childs[i].className = "select bb1f5";
                    else
                        childs[i].className = "noselect";
                }
                else
                {
                    if (target == childs[i])
                    {
                        if(i>1)
childs[i-1].className = "noselect bl1cc br1cc";
else
childs[i-1].className = "noselect br1cc";
                        childs[i].className = "select bb1f5";
                    }
                    else
                        childs[i].className = "noselect bl1cc";
                }
 
                document.getElementById("slide-tab-content").children[i].style.display = target == childs[i] ? "block" : "none";
            }
        }
    };
 
    tabs.func_get_position = function(obj)
    {
        var tmp_obj = obj;
        var result = {width : 0, height : 0, left : 0, top : 0};
 
        while (tmp_obj.offsetParent)
        {
            if (result.width == 0) result.width = tmp_obj.offsetWidth;
            if (result.height == 0) result.height = tmp_obj.offsetHeight;
 
            result.left += tmp_obj.offsetLeft;
            result.top += tmp_obj.offsetTop;
 
            tmp_obj = tmp_obj.offsetParent;
        }
 
        return result;
    };
 
    tabs.func_slide = function()
    {
        tabs.left -= (tabs.left - tabs.targetLeft) * 0.1;
        tabs.style.left = -tabs.left + "px";
 
        if (Math.round(tabs.left) == tabs.targetLeft)
            return;
 
        tabs.move_timeout = setTimeout(tabs.func_slide, 1);
    };
 
    tabs.onclick = tabs.func_onclick;
    window.onresize = function() { tabs.position = tabs.func_get_position(tabs); };
    tabs.onmousemove = function(e)
    {
        var e = e || window.event;
        this.percent = ((e.clientX - this.position.left) / tabs.parentNode.offsetWidth) * 100;
        this.targetLeft = Math.round(((this.offsetWidth - tabs.parentNode.offsetWidth) / 100) * this.percent);
 
        clearTimeout(this.move_timeout);
        this.move_timeout = setTimeout(tabs.func_slide, 1);
    };
 
    tabs.left = 0;
    tabs.is_move = false;
    tabs.target_obj = null;
    tabs.position = tabs.func_get_position(tabs);
 
    tabs.onselectstart = function() { return false; };
    tabs.ondragstart = function() { return false; };
};
</script>
else
                {
                    if (target == childs[i])
                    {
                       
childs[i-1].className = "noselect bl1cc br1cc";
                        childs[i].className = "select bb1f5";
                    }
                    else
                        childs[i].className = "noselect bl1cc";
                }

=>



                else
                {
                    if (target == childs[i])
                    {
                        if(i>1)
childs[i-1].className = "noselect bl1cc br1cc";
else
childs[i-1].className = "noselect br1cc";
                        childs[i].className = "select bb1f5";
                    }
                    else
                        childs[i].className = "noselect bl1cc";
                }



메뉴2를 클릭했을때 1px 오류는
메뉴2를 클릭했을때 i-1의 클래스(즉 메뉴1의 클래스) 변경이 들어가서 그렇습니다
왼쪽 border 변화가 생기는 거죠
메뉴 2일때는 border 변화가 생기지 않도록 if 문을 추가하시면 될것 같습니다.
위 댓글 소스에서 * {font-size:12px; font-family:dotum;}  는 삭제하시면 됩니다.
전체 66,554 |RSS
그누4 질문답변 내용 검색

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1402호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT