jquery로 이미지 노드를 만들고 원본 위에 더 큰 버전으로 표시하려고합니다.
복사 한 이미지가 Chrome 및 Safari에 표시되지 않지만 Internet Explorer 및 Firefox에서 작동합니다. 콘솔에서 오류를보고하지 않습니다. 속성 검사기는 모든 올바른 CSS 속성을 가진 복제 된 이미지 요소를 표시하지만 요소에 0 x 0 픽셀 크기를 제공합니다.이미지가 웹킷 브라우저에 jquery가 표시되지 않습니다.
0x0 크기를 암시하는 CSS 규칙이 없습니다. download.toastlab.ch/segtest
편집 : 여기
는 스크린 샷, 동작 데모를 파이어 폭스와 크롬 이미지를 클릭 시도 할 수있는 링크를 상황 ( http://i.stack.imgur.com/AhiPf.png) 여기입니다 설명한다 :
요소를 생성하는 자바 스크립트 코드 :
당신의 JS 코드에서$('.streamcontent').on('click', 'img.clickable', function() {
var img = new Image();
img.src = $(this).attr('src');
var w = img.width,
h = img.height;
img = $(img).addClass('bigger');
var tw = $(this).width();
var th = $(this).height();
var pos = $(this).position();
var center = {
top: pos.top + th/2,
left: pos.left + tw/2
};
img.css({
position: 'absolute',
top: pos.top,
left: pos.left,
width: tw,
height: th,
opacity: 0
}).animate({
top: center.top - h/2,
left: center.left - w/2,
height: h,
width: w,
opacity: 1
}, 300, function() {
$('body').one('click', function() {
img.animate({
top: pos.top,
left: pos.left,
width: tw,
height: th,
opacity: 0
}, function() {
img.remove();
});
});
});
$(this).parent().append(img);
});
JS 코드를 게시 할 수 있습니까? – Albinoswordfish
Chrome 21.0 및 IE 10.0.84에서 페이지가 저와 동일하게 보입니다 (이미지가 잘 보임). – MaxPRafferty
이상하게 들리니'Chrome 21.0.1180.83 m' :/ – Roman