◽ HTML & CSS & JS, jQuery

[JavaScript - (9) ] 이미지 원본사이즈에 맞게 새창 띄우기

 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<script>
        function image_popup(filename) {
            var url = filename;
            console.log("url : ");
            console.log(url);
             var imgObj = new Image();
             imgObj.src = "/resources/files/"+url+"";
             imageWin = window.open("""profile_popup""width=" + imgObj.width + "px, height=" + imgObj.height + "px"); 
             imageWin.document.write("<html><body style='margin:0'>"); 
             imageWin.document.write("<a href=javascript:window.close()><img src='" + imgObj.src + "' border=0></a>"); 
             imageWin.document.write("</body><html>"); 
             imageWin.document.title = imgObj.src;
 
            }
</script>
Color Scripter

푸터바