Open image in new window

后端 未结 7 979
执笔经年
执笔经年 2020-11-28 14:34

How can I open an image in a new window by using its id?

function swipe()
{   
    var largeImage = document.getElementById(\'largeImage\');
            


        
7条回答
  •  清酒与你
    2020-11-28 15:08

    For a new window that has a good chance of being lost behind the main window, and generally annoying visitors:

    window.open('http://example.com/someImage.png');
    

    I'd just stick to a regular link if I were you.

提交回复
热议问题