https://sir.kr/qa/378026 이 질문(글쓰기창 오류)을 했었는데여..
개발자도구 켜서 jquery 문제있다고해서 찾아봤는데
저거 문제 맞을까여?
혹시 맞다면 고칠 방법 좀 알려주실 수 있나여?ㅜ
(function($) {
$.fn.viewimageresize = function(selector)
{
var cfg = {
selector: "img"
};
if(typeof selector == "object") {
cfg = $.extend(cfg, selector);
} else {
if(selector) {
cfg = $.extend({ selector: selector });
}
}
var $img = this.find(cfg.selector);
var $this = this;
$img.removeAttr("height")
.css("height", "");
function image_resize()
{
var width = $this.width();
$img.each(function() {
if($(this).data("width") == undefined)
$(this).data("width", $(this).width());
if($(this).data("width") > width) {
$(this).removeAttr("width")
.removeAttr("height")
.css("width","")
.css("height", "");
if($(this).data("width") > width) {
$(this).css("width", "100%");
}
} else {
$(this).attr("width", $(this).data("width"));
}
});
}
$(window).on("load", function() {
image_resize();
});
$(window).on("resize", function() {
image_resize();
});
}
$.fn.viewimageresize2 = function(selector)
{
var cfg = {
selector: "img"
};
if(typeof selector == "object") {
cfg = $.extend(cfg, selector);
} else {
if(selector) {
cfg = $.extend({ selector: selector });
}
}
var $img = this.find(cfg.selector);
var $this = this;
function image_resize()
{
var width = $this.width();
$img.each(function() {
$(this).removeAttr("width")
.removeAttr("height")
.css("width","")
.css("height", "");
if($(this).data("width") == undefined)
$(this).data("width", $(this).width());
if($(this).data("width") > width) {
$(this).css("width", "100%");
}
});
}
$(window).on("resize", function() {
image_resize();
});
image_resize();
}
}(jQuery));

답변 3개 / 댓글 1개
다른 페이지에서는 아래처럼 정상적으로 jquery를 불러옵니다만 게시판 view 페이지에서는 못 불러오네요. 해당 게시판 header 부분에서 불러오는 파일 확인해 보세요. jquery를 안 쓴 게 아닌가 싶네요.
<script src="http://vlovemeiwonv.cafe24.com/js/jquery-1.12.4.min.js?ver=191202"></script>
<script src="http://vlovemeiwonv.cafe24.com/js/jquery-migrate-1.4.1.min.js?ver=191202"></script>
쟁반짜장님 말씀대로 다른 스크립트들이 없는것같네요
head.sub.php 인클루드 정상적으로 되었는지 확인해보시고
빌더사용중이시라면 빌더에서 별도로 js를 호출하는게 있는지 확인해서 넣어보세요
답변을 작성하려면 로그인이 필요합니다.