구글번역기 헤드에

구글번역기 헤드에

QA

구글번역기 헤드에

본문

PC버전과 모바일 버전에 각각 아래 코드를 "검색"하기를 삭제 하고 넣어도 적용이 안되네요.

단순히 아래 코드만 삭제하면 되는 것이 아닌가 봅니다.

========= 아  래 ========

 <div class="align-self-center px-4">

<div class="header-search">

<form name="tsearch" method="get" action="<?php echo G5_BBS_URL ?>/search.php" onsubmit="return tsearch_submit(this);" class="border-primary">

<input type="hidden" name="sfl" value="wr_subject||wr_content">

<input type="hidden" name="sop" value="and">

<div class="input-group input-group-lg">

<input type="text" name="stx" class="form-control en" value="<?php echo $stx ?>">

<div class="input-group-append">

<button type="submit" class="btn"><i class="fa fa-search fa-lg text-primary"></i></button>

</div>

</div>

</form>

========================아 래 끝 ==================================================================================

<!-- PC 헤더 시작 { -->

<header id="header_pc" class="d-none d-md-block">

<div class="nt-container py-4 px-3 px-sm-4 px-xl-0">

<div class="d-flex">

<div class="align-self-center">

<div class="header-logo">

<a href="<?php echo NT_HOME_URL ?>">

<img id="logo_img" src="<?php echo $tset['logo_img'] ?>" alt="<?php echo get_text($config['cf_title']) ?>">

</a>

</div>   

</div>

<div class="align-self-center px-4">

<div class="header-search">

<form name="tsearch" method="get" action="<?php echo G5_BBS_URL ?>/search.php" onsubmit="return tsearch_submit(this);" class="border-primary">

<input type="hidden" name="sfl" value="wr_subject||wr_content">

<input type="hidden" name="sop" value="and">

<div class="input-group input-group-lg">

<input type="text" name="stx" class="form-control en" value="<?php echo $stx ?>">

<div class="input-group-append">

<button type="submit" class="btn"><i class="fa fa-search fa-lg text-primary"></i></button>

</div>

</div>

</form>

<div class="header-keyword mt-2">

<?php echo na_widget('data-keyword', 'popular', 'q=아미나,나리야,플러그인,그누보드5.4,부트스트랩4,테마,스킨,위젯,애드온'); ?>

</div>

</div>   

</div>

<div class="align-self-center ml-auto">

<!-- 배너 등 우측 영역 컨텐츠 -->

 

 

 

 

</div>

</div>

</div>

</header>

<!-- } PC 헤더 끝 -->

 

<!-- 상단고정 시작 { -->

<div id="nt_sticky_wrap">

<!-- 모바일 헤더 { -->

<header id="header_mo" class="d-block d-md-none">

<div class="bg-primary px-3 px-sm-4">

<h3 class="clearfix text-center f-mo font-weight-bold en">

<a href="javascript:;" onclick="sidebar('menu');" class="float-left">

<i class="fa fa-bars text-white" aria-hidden="true"></i>

<span class="sr-only">메뉴</span>

</a>

<div class="float-right">

<a data-toggle="collapse" href="#search_mo" aria-expanded="false" aria-controls="search_mo" class="ml-3">

<i class="fa fa-search text-white" aria-hidden="true"></i>

<span class="sr-only">검색</span>

</a>

</div>

<!-- Mobile Logo -->

<a href="<?php echo NT_HOME_URL ?>" class="text-white">

<?php echo $tset['logo_text'] ?>

</a>

</h3>

</div>

<div id="search_mo" class="collapse">

<div class="mb-0 p-3 px-sm-4 d-block d-lg-none border-bottom">

<form name="mosearch" method="get" action="<?php echo G5_BBS_URL ?>/search.php" onsubmit="return tsearch_submit(this);" class="mb-0">

<input type="hidden" name="sfl" value="wr_subject||wr_content">

<input type="hidden" name="sop" value="and">

<div class="input-group">

<input id="mo_top_search" type="text" name="stx" class="form-control" value="<?php echo $stx ?>" placeholder="검색어">

<span class="input-group-append">

<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i></button>

</span>

</div>

</form>

</div>

</div>

</header>

<!-- } 모바일 헤더 끝 -->

 

 

=== 이 아래 코드를 헤드에 넣고 싶습니다. =====

 

<p>This example displays a simple translate button, with no text.</p>
<p><a translate="no" target="_top" href="https://codepen.io/kimone0915/pen/mdRMWxz">
Edit this code</a></p><br>


<div id="translation"></div>

<script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=google_translate"></script>
<script>
function google_translate (){ 
    var opt = { 
        layout: google.translate.TranslateElement.InlineLayout.SIMPLE, 
        pageLanguage: "en" 
    }; 
    new google.translate.TranslateElement( opt, "translation" ); 
} 

/*  
Display the scrollable list of languages. 
Related to the size of current browser. 
*/
addEventListener( "load", function(){ 
    if ( document.querySelector(".goog-te-menu-frame") ) { 
    
        document.getElementById( "translation" ).addEventListener( "click", function(){ 
            if ( this.id === "translation" ) scrollableLanguagesList(); 
        }); 
        addEventListener( "resize", function(){ 
            if ( "none" !== document.querySelector(".goog-te-menu-frame").style.display ) scrollableLanguagesList(); 
        }); 
    
    } 
}); 

function scrollableLanguagesList (){ 
    var 
     iframe = document.querySelector( ".goog-te-menu-frame" ), 
     doc = iframe.contentWindow.document, 
     div = doc.body.children[ 0 ], 
     table = div.children[ 0 ], 
     width = div.dataset.width || parseInt( div.style.width ), 
     rect, diff; 
    
    if ( ! div.dataset.width ) div.dataset.width = width; 
    
    if ( innerWidth < width ) { 
        rect = table.getBoundingClientRect(); 
        width = rect.right - rect.left; 
        diff = width - innerWidth; 
        
        div.style.width = ( width - diff - 24 ) + "px"; 
        div.style.padding = "4px 0 1em 4px"; 
        div.style.overflowX = "scroll"; 
    } 
    else { 
        div.style.width = "auto"; 
        div.style.padding = "4px"; 
        div.style.overflowX = "visible"; 
    } 
    
    rect = div.getBoundingClientRect(); 
    iframe.style.width = ( rect.right - rect.left ) + "px"; 
    iframe.style.height = ( rect.bottom - rect.top ) + "px"; 
} 
</script>

이 질문에 댓글 쓰기 :

답변 3

답변 감사 드립니다.

내용은 아래와 같습니다.

 

파이코인 채굴

http://picore.cafe24.com/ 

 

에 들어 가보시면 타이틀 좌측에 보시면 언어선택이 있습니다.

PC버전과 모바일 버전에 각각 아래 코드를 "검색"하기를 삭제 하고 넣어도 적용이 안되서 

할 수 없이 인덱스의 타이틀 바로 아래에 배치 시켰습니다.

 

문제는 PC버전은 상관없는데 모바일 버전에서 각 국어 선택이 잘려 나오는 현상이 있어서

스크롤로 할 수 있게 하였으나 맨 처음 도메인으로 접속시에는 스크롤을 이용하여 국가 언어 선택이 잘 보여지는데 

 

페이지가 넘어가면 즉 최신글 선택 후 언어선택에서 보면 스크롤이 아예 박스도 보여지지 않고 적용이 안됩니다.

물론 첫 인덱스 화면에서 언어(예:영어)를 선택 한 후 최신글을 보면 되지만 경우에 따라서 

 

최신글을 직접 선택 후 언어를 선택 할 수도 있어서 시도 해보려 합니다. 

그런데 이스크립트가 먹히질 않는 것 입니다.

 

그래서 PC버전과 모바일 버전 헤드에 검색기능(돋보기)을 없애고 각각 이스크립트를 넣고자 시도 하였는데

나타내져 지지 않는 것 입니다.thumb-3554212097_1619631148.3137_730x531.png

답변을 작성하시기 전에 로그인 해주세요.
전체 78
QA 내용 검색

회원로그인

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