타겟 설정 좀 도아주세요.
본문
새창이 뜨는데요.
어느 부분에 target="_parent" 넣어줘야 할까요?
그리고 박스가 작게 나오는데
좀 크게 나오게 할 수 있을까요?
<?php
if (!defined('_GNUBOARD_')) exit; // 개별 페이지 접근 불가
// add_stylesheet('css 구문', 출력순서); 숫자가 작을 수록 먼저 출력됨
add_stylesheet('<link rel="stylesheet" href="'.$latest_skin_url.'/style.css">', 1);
?>
<script>
jQuery(document).ready(function(){
var select = $("select#color");
select.change(function(){
var select_name = $(this).children("option:selected").text();
$(this).siblings("label").text(select_name);
});
});
</script>
<!-- <?php echo $bo_subject; ?> 최신글 시작 { -->
<div id="select_box">
<select id="color" title="인증업체 선택" onchange="if(this.value) window.open(this.value);">
<option selected="selected" value=''>인증업체 선택</option>
<?php for ($i=0; $i<count($list); $i++) {
echo "<option value='{$list[$i]['wr_link1']}'>{$list[$i]['subject']}</option>";
} ?>
</select>
</div>
<!-- } <?php echo $bo_subject; ?> 최신글 끝 -->
답변 3
<style>
select#color { width:200px; line-height:35px; height:35px; border:1px solid #ddd }
</style>
<select id="color" title="인증업체 선택" onchange="if(this.value) window.open(this.value, '_parent');">
위에서 작성하신 부분의
<select id="color" title="인증업체 선택" onchange="if(this.value) window.open(this.value);">
영역에서
onchange 영역을 다시 작성하세요
함수로 만들어 처리하는방식으로 설명을 드리면
Onchange="f_open(this.value);"
와 같이 처리를 하시고
function f_open(val){
if (val) {
window.open(url, target, [option]);
}
}
하시면 됩니다.
https://www.w3schools.com/jsref/met_win_open.asp
를 참고해보세요
target 을 처리하는 방식중에는 form 을 사용하는 방식도 있습니다.
!-->Onchange="f_open(this.value);" 이걸 처리해 보세요
답변을 작성하시기 전에 로그인 해주세요.