묻고답하기

고수분들에게 도움을 구하고자 글을 남김니다...

 

도움을 주신다면 정말 감사히 생각하겠습니다.

 

익스9 와 크롬에서는 정상작동을 하나 익스8 이하로는 작동이 되지 않아서 질문드립니다.

 

문제는 상단에 슬라이드 갤러리가 있고 하단에 아이프레임으로 컨텐츠를 불러옵니다.
(1개의 아이프레임에 버튼클릭에 따라 타겟으로 다른 문서 또는 게시판을 불러옵니다.)

 

아이프레임의 세로길이를 자동으로 조절하기 위하여 onload 를 사용하였습니다.
헌데 이 onload 함수가 출동을 일으켜 익스 8이하의 브라우져에서는 상단의 갤러리가 작동되지 않습니다.

 

어떠한 방향으로 해결하는것이 좋은 방법일지 조언 부탁드립니다.

 

아래는 염치불구하고 사용된 코드입니다.

감사합니다.


--------------------------------------------------------------------------------------------------------------------------------------------


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
    <head>
        <title>main_visual</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
        <meta name="description" content="Parallax Slider with jQuery" />
        <link rel="stylesheet" type="text/css" href="style.css" />

 
<script type="text/javascript">

  var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-7243260-2']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

</script>

<script type="text/javascript">

function iframe_autoresize(arg)

{
    arg.height = 0;
    arg.height = eval(arg.name+".document.body.scrollHeight");
}

</script>


<script type="text/javascript">
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
</script>
</head>
    <body>

 <div id="pxs_container" class="pxs_container">
         <div class="pxs_bg">
    <div class="pxs_bg1"></div>
    <div class="pxs_bg2"></div>
    <div class="pxs_bg3"></div>
   </div>
   <!--<div class="pxs_loading">Loading...</div>-->
   <div class="pxs_slider_wrapper">
    <ul class="pxs_slider">
     <li><img src="logo_sample.png" /></li>
     <li><img src="logo_sample_02.png" /></li>
     <div><img src="logo_sample_03.png" /></div>
    </ul>
    
    <ul class="pxs_thumbnails">
                    <div style="float:left;"><a href="test.html" target="contents_01" onfocus="this.blur()" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image1','','mainmenu_01_over.png',1)"><img src="mainmenu_01.png" id="Image1" /></a></div>
                    <div style="float:left;"><a href="test_02.html" target="contents_01" onfocus="this.blur()" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image2','','mainmenu_02_over.png',2)"><img src="mainmenu_02.png" id="Image2" /></a></div>
                    <div style="float:left;"><a href="test_03.html" target="contents_01" onfocus="this.blur()" onmouseout="MM_swapImgRestore()" onmouseover="MM_swapImage('Image3','','mainmenu_03_over.png',3)"><img src="mainmenu_03.png" id="Image3" /></a></div>
                   
    </ul>
   </div>
           
           
  </div>

  <div class="pxs_loading"><img src="logo.png" /></div>
       
        <div class="pxs_loading_02"><img src="contact.png" /></div>
                
        <div class="footer"><iframe name="contents_01" allowtransparency="true" id='myframe' src="test.html" style="width:100%" frameborder="0" framespacing="0" scrolling="no" onload="iframe_autoresize(this)"></iframe>
       
        </div>
       
        <center>
        <div style="background-image:url(bg_bottom.jpg); background-repeat:repeat-x; height:55px;"><img src="bottom.png" /></div>
        </center>
               

  <!-- The JavaScript -->
  <script type="text/javascript" src="      //the elements in the slider
      $elems   = $pxs_slider.children(),
      //total number of elements
      total_elems  = $elems.length,
      //the navigation buttons
      $pxs_next  = $('.pxs_next',$pxs_container),
      $pxs_prev  = $('.pxs_prev',$pxs_container),
      //the bg images
      $pxs_bg1  = $('.pxs_bg1',$pxs_container),
      $pxs_bg2  = $('.pxs_bg2',$pxs_container),
      $pxs_bg3  = $('.pxs_bg3',$pxs_container),
      //current image
      current   = 0,
      //the thumbs container
      $pxs_thumbnails = $('.pxs_thumbnails',$pxs_container),
      //the thumbs
      $thumbs   = $pxs_thumbnails.children(),
      //the interval for the autoplay mode
      slideshow,
      //the loading image
      $pxs_loading = $('.pxs_loading',$pxs_container),
      $pxs_slider_wrapper = $('.pxs_slider_wrapper',$pxs_container);
       
      //first preload all the images
      var loaded  = 0,
      $images  = $pxs_slider_wrapper.find('img');
       
      $images.each(function(){
       var $img = $(this);
       $('<img/>').load(function(){
        ++loaded;
        if(loaded == total_elems*2){
         $pxs_loading.hide();
         $pxs_slider_wrapper.show();
          
         //one images width (assuming all images have the same sizes)
         var one_image_w  = $pxs_slider.find('img:first').width();
       
         /*
         need to set width of the slider,
         of each one of its elements, and of the
         navigation buttons
          */
         setWidths($pxs_slider,
         $elems,
         total_elems,
         $pxs_bg1,
         $pxs_bg2,
         $pxs_bg3,
         one_image_w,
         $pxs_next,
         $pxs_prev);
       
         /*
          set the width of the thumbs
          and spread them evenly
          */
         $pxs_thumbnails.css({
          'width'   : one_image_w + 'px',
          'margin-left'  : -one_image_w/2 + 'px'
         });
         var spaces = one_image_w/(total_elems+1);
         $thumbs.each(function(i){
          var $this  = $(this);
          var left = spaces*(i+1) - $this.width()/2;
          $this.css('left',left+'px');
          
          //hovering the thumbs animates them up and down
          $this.bind('mouseenter',function(){
           $(this).stop().animate({top:'-10px'},100);
          }).bind('mouseleave',function(){
           $(this).stop().animate({top:'0px'},100);
          });
         });
          
         //make the first thumb be selected
         highlight($thumbs.eq(0));
          
         //slide when clicking the navigation buttons
         $pxs_next.bind('click',function(){
          ++current;
          if(current >= total_elems)
           if(o.circular)
            current = 0;
          else{
           --current;
           return false;
          }
          highlight($thumbs.eq(current));
          slide(current,
          $pxs_slider,
          $pxs_bg3,
          $pxs_bg2,
          $pxs_bg1,
          o.speed,
          o.easing,
          o.easingBg);
         });
         $pxs_prev.bind('click',function(){
          --current;
          if(current < 0)
           if(o.circular)
            current = total_elems - 1;
          else{
           ++current;
           return false;
          }
          highlight($thumbs.eq(current));
          slide(current,
          $pxs_slider,
          $pxs_bg3,
          $pxs_bg2,
          $pxs_bg1,
          o.speed,
          o.easing,
          o.easingBg);
         });
       
         /*
         clicking a thumb will slide to the respective image
          */
         $thumbs.bind('click',function(){
          var $thumb = $(this);
          highlight($thumb);
          //if autoplay interrupt when user clicks
          if(o.auto)
           clearInterval(slideshow);
          current  = $thumb.index();
          slide(current,
          $pxs_slider,
          $pxs_bg3,
          $pxs_bg2,
          $pxs_bg1,
          o.speed,
          o.easing,
          o.easingBg);
         });
       
        
       
         /*
         activate the autoplay mode if
         that option was specified
          */
         if(o.auto != 0){
          o.circular = true;
          slideshow = setInterval(function(){
           $pxs_next.trigger('click');
          },o.auto);
         }
       
         /*
         when resizing the window,
         we need to recalculate the widths of the
         slider elements, based on the new windows width.
         we need to slide again to the current one,
         since the left of the slider is no longer correct
          */
         $(window).resize(function(){
          w_w = $(window).width();
          setWidths($pxs_slider,$elems,total_elems,$pxs_bg1,$pxs_bg2,$pxs_bg3,one_image_w,$pxs_next,$pxs_prev);
          slide(current,
          $pxs_slider,
          $pxs_bg3,
          $pxs_bg2,
          $pxs_bg1,
          1,
          o.easing,
          o.easingBg);
         });

        }
       }).error(function(){
        alert('here')
       }).attr('src',$img.attr('src'));
      });
       
       
       
     });
    };
    
    //the current windows width
    var w_w    = $(window).width();
    
    var slide   = function(current,
    $pxs_slider,
    $pxs_bg3,
    $pxs_bg2,
    $pxs_bg1,
    speed,
    easing,
    easingBg){
     var slide_to = parseInt(-w_w * current);
     $pxs_slider.stop().animate({
      left : slide_to + 'px'
     },speed, easing);
     $pxs_bg3.stop().animate({
      left : slide_to/2 + 'px'
     },speed, easingBg);
     $pxs_bg2.stop().animate({
      left : slide_to/4 + 'px'
     },speed, easingBg);
     $pxs_bg1.stop().animate({
      left : slide_to/8 + 'px'
     },speed, easingBg);
     
    }
    
    
    var highlight  = function($elem){
     $elem.siblings().removeClass('selected');
     $elem.addClass('selected');
    }
    
    var setWidths  = function($pxs_slider,
    $elems,
    total_elems,
    $pxs_bg1,
    $pxs_bg2,
    $pxs_bg3,
    one_image_w,
    $pxs_next,
    $pxs_prev){
     /*
     the width of the slider is the windows width
     times the total number of elements in the slider
      */
     var pxs_slider_w = w_w * total_elems;
     $pxs_slider.width(pxs_slider_w + 'px');
     //each element will have a width = windows width
     $elems.width(w_w + 'px');
     /*
     we also set the width of each bg image div.
     The value is the same calculated for the pxs_slider
      */
     $pxs_bg1.width(pxs_slider_w + 'px');
     $pxs_bg2.width(pxs_slider_w + 'px');
     $pxs_bg3.width(pxs_slider_w + 'px');
     
     /*
     both the right and left of the
     navigation next and previous buttons will be:
     windowWidth/2 - imgWidth/2 + some margin (not to touch the image borders)
      */
     var position_nav = w_w/2 - one_image_w/2 + 3;
     $pxs_next.css('right', position_nav + 'px');
     $pxs_prev.css('left', position_nav + 'px');
    }
    
    $.fn.parallaxSlider.defaults = {
     auto   : 0, //how many seconds to periodically slide the content.
           //If set to 0 then autoplay is turned off.
     speed   : 2000,//speed of each slide animation
     easing   : 'jswing',//easing effect for the slide animation
     easingBg  : 'jswing',//easing effect for the background animation
     circular  : true,//circular slider
     thumbRotation : true//the thumbs will be randomly rotated
    };
    //easeInOutExpo,easeInBack
   })(jQuery);
  </script>

  <script type="text/javascript">
   $(function() {
    var $pxs_container = $('#pxs_container');
    $pxs_container.parallaxSlider();
   });
        </script>
    </body>
</html>

글쓴이 제목 최종 글
XE 공지 글 쓰기,삭제 운영방식 변경 공지 [16] 2019.03.05 by 남기남
KTK 송동우님 저번에 답변해주신 문제입니다..  
괴고 XE 설치시 오류요... [1] 2013.02.13 by 푸시아
uoou 페이스북 좋아요 버튼 클릭시 확인버튼 생성 문제 file  
꿈틀잉 sql 제목부분 일괄 수정질문요.. [1] file 2013.02.13 by 송동우
귀여운유니 댓글 정렬 질문입니다. [1] 2013.02.13 by 송동우
BonaSera 서버 이전 후, 어드민 로긴 안되고, 404에러 뜹니다. [2] 2013.02.13 by BonaSera
音志 회원 이미지 이름 사용에 그룹제한을 걸고 싶습니다. [1] 2013.02.13 by 송동우
XE만세 서버 이전시 새로 업데이트된 글/댓글을 옮기려면..  
도로테비 모바일 페이지가 자동으로 리사이징이 안돼요 [3] 2013.02.13 by drimilda
프머000 포인트 관련 질문드려요~ [2] 2013.02.13 by sejin7940
도와주세요! 댓글이 새로고침해야 등록이 됩니다 ㅠㅠ [1] 2013.02.13 by 리사땅
nimm DB에 files 테이블에서요..  
윤씨 단축키 지정 문제.. (다시 올립니다.) [1] 2013.02.13 by 푸시아
KTK 게시글 작성시 특정 단어 작성금지 [1] 2013.02.13 by 송동우
아.. 댓글만 그런게 아니였네요.. 게시글도 마찬가집니다.. 해결이안되요! [2] 2013.02.13 by 몽실아빠
우탕카멘 xe에는 이벤트형 게시판이 없을까요? [1] 2013.02.13 by 송동우
토이터 카테고리를 두개 사용하려면 어디를 수정해야할까요? [1] file 2013.02.13 by LI-NA
monu 게시글 공유 질문 [1] 2013.02.13 by LI-NA
원보드 특정 추천수 이상시 게시물 이동하는 에드온(확실히 작동하는 걸로요)좀요 [1] 2013.02.13 by XE만세
wulff 레이아웃 일괄적용을 잘못 눌렀는데... [2] 2013.02.13 by XE만세
PEANUTSOUL 홈페이지를 복사하려고 합니다. [2] file 2013.02.13 by 일모도원
디자인플레이 onload 충돌에 관한 질문입니다.  
wulff 플래시 메뉴 문제...  
Choi 2차 도메인 설정에 관하여 질문드립니다 [1] 2013.02.14 by TUW
델파 메인페이지...최신 게시글 위젯관련질문입니다~! [2] file 2013.02.14 by 송동우
원보드 직접 서버 컴퓨터를 구입해서 운영하면 트래픽은 무제한이 되나요? [4] 2013.02.14 by TUW
작은농부 http 406 승인금지 에러가 떠요. file  
이동화309 content 확장 위젯2 [2] 2013.02.14 by 이동화309
오락실주인 중국쪽 IP 차단하는방법 [1] 2013.02.14 by 송동우
nimm DB의 files테이블에 관해 다시 질문드립니다.. [1] 2013.02.14 by 송동우