我的图片在DIV里面显示左右可以居中。上下就是不行。求高手指导
大谷子 2013-08-14 03:10:01 this.imagePreview = function() {
xOffset = 10;
yOffset = 150;
$("a.preview").hover(function(e) {
this.t = this.title;
this.title = "";
var c = (this.t != "") ? "<br/>" + this.t : "";
$("body").append("<table><tr><td id='preview' align='center' valign='middle'><img style='vertical-align:middle; align='absmiddle'' src='" + this.href + "' alt='图片放大' /></td> </tr></table>");
$("#preview")
.css("top", (e.pageY - xOffset) + "px")
.css("right", (yOffset) + "px")
.fadeIn("fast");
$("#preview").animate({ 'width': '47%', 'height': '70%' })
},
function() {
this.title = this.t;
$("#preview").remove();
});
$("a.preview").mousemove(function(e) {
$("#preview")
.css({ 'top': '40px', 'right': '195px' })
});
};