经过 img src 穿过 jquery 在新的 div

我正在尝试创建一个模态类型的操作 "simple". 当用户单击图像时,它会在屏幕上方打开掩码 /做好了/ 并显示图像 /不能这样做/. 它应该非常简单,没有必要的画廊等,因此,只是一种简单的效果。

为掩码生成的代码看起来像这样:


$j/document/.ready/function//{
$j/'.postentry img'/.click/function/e/ {
e.preventDefault//;
var maskHeight = $j/document/.height//;
var maskWidth = $j/window/.width//;
$j/'#mask'/.css/{'width':maskWidth,'height':maskHeight}/;
$j/'#mask'/.fadeIn/1000/;
$j/'#mask'/.fadeTo/"slow",0.8/;
}/;


}/;

我可以得到 src 图片 /但刚忘记了代码/, 但它是如此


Sj/'postentry img'/.att/src/


/或者我真的让它正确地显示在警告中,但我如何传达这一点 sc 在隐藏 div 并在面具上方显示它 /嗯,我想它是一个z索引 css/, 但它看起来更像是我显示图像的方式。

帮助,请谢谢
已邀请:

郭文康

赞同来自:

你需要做到这一点


$/'.postentry img'/.attr/'src', 'imageurl'/.show//;


或简单


$/'.postentry img'/.attr/'src', 'imageurl'/;


然后显示 div, 包含图像使用


$/'#imagediv'/.show//;


如果你展示你的 html, 我可以给出一个明确的答案。 另外,你不需要放 j 后 $.

风见雨下

赞同来自:

他的


$j/'postentry img'/.attr/src/



http://api.jquery.com/attr/
要显示图像,可以调用该方法 .show//


$j/'postentry img'/.attr/'src', yourimageurl/.show//;



http://api.jquery.com/show/

要回复问题请先登录注册