질문좀 드리겠습니다

질문좀 드리겠습니다

QA

질문좀 드리겠습니다

본문

changeView 이벤트를 클릭을 해야지만  

지도가 출력이 됩니다 클릭 이벤트를 빼고 그냥 출력 되게끔 할려면 혹시 어떻게 해야할까요 

 

 

 

function changeView(mode){

$(".inquiryArea .mapicon .mapicon1 a").removeClass("mapOn");

$(".inquiryArea .mapicon .mapicon2 a").removeClass("roadOn");

$(".inquiryArea .mapicon .mapicon3 a").removeClass("videoOn");

if(mode == "map"){

if($("#hInfo_detail #map").css('display') == 'block'){

$("#hInfo_detail #map").hide().html();

return false;

}

$(".inquiryArea .mapicon .mapicon1 a").addClass("mapOn");

$(".inquiryArea #road").hide().html('');

$(".inquiryArea #video").hide();

$(".inquiryArea #map").show();

map.init('map', '<? echo $view['zoom']; ?>', '<? echo $view['lat']; ?>', '<? echo $view['lng']; ?>');

// 지도를 클릭한 위치에 표출할 마커입니다

var position = new daum.maps.LatLng(<? echo $view['lat']; ?>, <? echo $view['lng']; ?>);

var dImageSize = new daum.maps.Size(72, 72);

var dImage = new daum.maps.MarkerImage("/data/category/<? echo $view['ca_name']; ?>.jpg", dImageSize); 

var marker = new daum.maps.Marker({

position:position,

image : dImage

})

marker.setMap(dMap);

}else if(mode == "road"){

if($("#hInfo_detail #road").css('display') == 'block'){

$("#hInfo_detail #road").hide().html();

return false;

}

$(".inquiryArea .mapicon .mapicon2 a").addClass("roadOn");

$(".inquiryArea #map").hide().html('');

$(".inquiryArea #video").hide();

$(".inquiryArea #road").show();

map.road('road', "<? echo $view['rLat']; ?>", "<? echo $view['rLng']; ?>");

dRoad.setPanoId(<?=$view['roadPanoid']?>);

dRoad.setViewpoint({ pan: <?=$view['roadPan']?>, tilt: <?=$view['roadTilt']?>, zoom: <?=$view['roadZoom']?> });

}else if(mode == "video"){

if($("#hInfo_detail #video").css('display') == 'block'){

$("#hInfo_detail #video").hide();

return false;

}

$("#hInfo_detail .detailContent .content .inquiryArea .mapicon .mapicon3 a").addClass("videoOn");

$("#hInfo_detail #map").hide().html('');

$("#hInfo_detail #road").hide().html('');

$("#hInfo_detail #video").show();

}

}

 

 

 

이 질문에 댓글 쓰기 :

답변 2

$(document).ready(function() {

  $changeView(map);

});

추가하면 될듯 하네요 

그냥 저 소스 아래에 넣으시면 될듯 한데요 

넣어도 안먹히네요 ㅠㅠ

$(document).ready(function(){
var winWidth = $(window).width();
var imgCover = (winWidth - 720) / 2;
$("#hInfo_detail .dBWrap .leftCover, #hInfo_detail .dBWrap .rightCover").css("width",imgCover+"px");


$("#hInfo_detail .detailContent .detailNav .tabMenu a").click(function(){
var id = $(this).attr("data-id");

$("#hInfo_detail .detailContent .detailNav a").removeClass("on");
$(this).addClass("on");

$("#hInfo_detail .detailContent .detailNav .Hinfo").hide();
$("#hInfo_detail .detailContent .detailNav .Dintro").hide();
$("#hInfo_detail .detailContent .detailNav .Hevent").hide();
$("#hInfo_detail .detailContent .detailNav .Hreview").hide();

$("#hInfo_detail .detailContent .detailNav ."+id).show();
})

if(location.hash == '#review') {
$("#hInfo_detail .detailContent .detailNav a").removeClass("on");
$("#hInfo_detail .detailContent .detailNav a").eq(3).addClass("on");
$("#hInfo_detail .detailContent .detailNav .Hinfo").hide();
$("#hInfo_detail .detailContent .detailNav .Hreview").show();
}

var bnTop = $(".inquiryArea").offset();
$(window).scroll(function(){
var sTop = $(window).scrollTop() + 64;
if(sTop > bnTop.top){
$(".inquiryArea #fixArea").addClass("inquiryFix");
}else{
$(".inquiryArea #fixArea").removeClass("inquiryFix");
}
})

$(document).on("click", "#hInfo_detail .detailContent .content .detailArea .detailNav .Hevent .event ul li .textArea .wish .favorite", function(){
<? if($is_member){ ?>
medi.setFavorite($(this));
<?}else{?>
medi.openPOP("login");
<? } ?>
});

$(document).on("click", "#hInfo_detail .detailContent .content .detailArea .title .titleArea .wishBtn a", function(){
<? if($is_member){ ?>
medi.setFavoriteBg($(this));
<?}else{?>
medi.openPOP("login");
<? } ?>
});

})

 
function changeView(mode){
$(".inquiryArea .mapicon .mapicon1 a").removeClass("mapOn");
$(".inquiryArea .mapicon .mapicon2 a").removeClass("roadOn");
$(".inquiryArea .mapicon .mapicon3 a").removeClass("videoOn");
if(mode == "map"){
if($("#hInfo_detail #map").css('display') == 'block'){
$("#hInfo_detail #map").hide().html();
return false;
}
$(".inquiryArea .mapicon .mapicon1 a").addClass("mapOn");
$(".inquiryArea #road").hide().html('');
$(".inquiryArea #video").hide();
$(".inquiryArea #map").show();
 
map.init('map', '<? echo $view['zoom']; ?>', '<? echo $view['lat']; ?>', '<? echo $view['lng']; ?>');
// 지도를 클릭한 위치에 표출할 마커입니다
 
var position = new daum.maps.LatLng(<? echo $view['lat']; ?>, <? echo $view['lng']; ?>);
var dImageSize = new daum.maps.Size(72, 72);
var dImage = new daum.maps.MarkerImage("/data/category/<? echo $view['ca_name']; ?>.jpg", dImageSize);
var marker = new daum.maps.Marker({
position:position,
image : dImage
})
marker.setMap(dMap);

}
 

else if(mode == "road"){
if($("#hInfo_detail #road").css('display') == 'block'){
$("#hInfo_detail #road").hide().html();
return false;
}
$(".inquiryArea .mapicon .mapicon2 a").addClass("roadOn");
$(".inquiryArea #map").hide().html('');
$(".inquiryArea #video").hide();
$(".inquiryArea #road").show();
map.road('road', "<? echo $view['rLat']; ?>", "<? echo $view['rLng']; ?>");
dRoad.setPanoId(<?=$view['roadPanoid']?>);
dRoad.setViewpoint({ pan: <?=$view['roadPan']?>, tilt: <?=$view['roadTilt']?>, zoom: <?=$view['roadZoom']?> });
}else if(mode == "video"){
if($("#hInfo_detail #video").css('display') == 'block'){
$("#hInfo_detail #video").hide();
return false;
}
$("#hInfo_detail .detailContent .content .inquiryArea .mapicon .mapicon3 a").addClass("videoOn");
$("#hInfo_detail #map").hide().html('');
$("#hInfo_detail #road").hide().html('');
$("#hInfo_detail #video").show();
}
}

  $(document).ready(function() {
  $changeView(map);
});
function hSlideRight(){
$("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea").animate({

},function(){
var tmpPreImg = $("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea img").eq(0).attr("src");
$("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea").css("left","0").append("<img src="+tmpPreImg+" width=800 height=500>");
$("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea img").eq(0).remove();
})
}

function hSlideLeft(){
var tmpPreImgNum = $("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea img").length - 1;
var tmpPreImg = $("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea img").eq(tmpPreImgNum).attr("src");
$("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea img").eq(tmpPreImgNum).remove();
$("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea").css("left","0px").prepend("<img src="+tmpPreImg+" width=800 height=500>");
$("#hInfo_detail .dBWrap .detailBanner .dBArea .imgArea").animate({

})
}

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

회원로그인

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