想要使用jQuery在新窗口中显示图像 [英] want to show the image in a new window using jquery

查看:69
本文介绍了想要使用jQuery在新窗口中显示图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Now the image is shown on the page but I want to show the image in a new window using jquery , in asp.net app.please help me.



jQuery的:



jquery:

<script type="text/javascript" language="ecmascript">

      function ShowBiggerImage(obj) {

          document.getElementById("imgdiv").style.visibility = "visible";
          document.getElementById("imgdiv").innerHTML = "<img src='" + obj.src + "'+'width=640 height=480' >";
          document.getElementById("imgdiv").style.left = event.clientX;
          document.getElementById("imgdiv").style.top = event.clientY;

          document.getElementById("imgdiv").style.zIndex = "0";

      }
      function ShowDefaultImage(obj) {
          document.getElementById("imgdiv").innerHTML = "";
          document.getElementById("imgdiv").style.visibility = "hidden";
      }


  </script>

推荐答案



尝试像这样
Hi,

try Like This
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Untitled Document</title>
<script type="text/javascript">

function image() {
    var img = document.createElement("IMG");
    img.src = "img/dir.gif";
    document.getElementById('image').appendChild(img);
}
</script>
</head>

<body>
<div id="image"></div>
<div><a href="javascript:image();">click to see image</a></div>
</body>
</html>



希望对您有帮助
祝你好运



hope it Helps you
Best Luck


这篇关于想要使用jQuery在新窗口中显示图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆