문제

Jquery를 구현하려고 해요 내 Joomla 기반 웹사이트의 카탈로그 이미지에 있습니다.이 문제를 해결할 수 없습니다. 이 문제를 해결하도록 도와줄 수 있는 사람이 있나요?

헤드에 다음 스크립트를 추가했습니다.

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js" type="text/javascript"></script>
<script src="http://www.myurl.mk/templates/beez_20/javascript/jquery.zoom.js"></script>

여기에 제공되는 오류는 다음과 같습니다.

Uncaught TypeError: Object #<HTMLDocument> has no method 'ready'
(anonymous function)

여기 내 사이트의 예에 대한 링크가 있습니다

내 코드는 다음과 같습니다.

<script>
        $(document).ready(function(){
            $('#ex1').zoom({url: '<?php echo $this->item->imageXLarge; ?>'});
        });
    </script>
      <div class="itemImageBlock" style="float:none;">
          <span class="itemImage" id="ex1">
                <img src="<?php echo $this->item->image; ?>" alt="<?php if(!empty($this->item->image_caption)) echo K2HelperUtilities::cleanHtml($this->item->image_caption); else echo K2HelperUtilities::cleanHtml($this->item->title); ?>" style="width:<?php echo $this->item->imageWidth; ?>px; height:auto;" />
          </span>
도움이 되었습니까?

해결책

귀하의 페이지를 보니 종속 파일 다음에 jQuery 파일을 로드하고 있는 것으로 나타났습니다.콘솔에 오류가 많습니다.첫 번째는 정의되지 않은 jQuery입니다.다른 모든 스크립트 파일보다 먼저 jQuery 파일을 이동하십시오.

jQuery를 맨 위로 이동한 후 사이트가 괜찮아 보입니다.요청하신 대로 스냅샷을 첨부했습니다.enter image description here

다른 팁

예제 페이지에서는 jquery.js보다 먼저 ks2.js를 가져옵니다.

이 항목은 귀하의 다음 첫 번째 항목이어야 합니다. <head> 꼬리표:

<script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.8/jquery-ui.min.js" type="text/javascript"></script>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top