jQuery $('#image').addimagezoom,用于从数据库散布的图片 [英] JQuery $('#image').addimagezoom, for pics dispersed from database

查看:64
本文介绍了jQuery $('#image').addimagezoom,用于从数据库散布的图片的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个变量,用于显示引用数据库中某一行的图片.

I have a variable that displays pictures that reference a row in a database.

当我将Javascript用于magnifyzoom时:

When I use the the Javascript for magnifyzoom:

 "$('#image1').addimagezoom({ // single image zoom
        zoomrange: [3, 10],
        magnifiersize: [300,300],
        magnifierpos: 'left',
        cursorshade: true,
        largeimage: ''                "
    })

它只会放大第一张图像.然后,当我用一个句点更改井号时,将ID切换为CLASS,它将放大所有图像,但会分散一种图像.如果您需要更多信息来帮助解决这个难题,请告诉我.

It will only zoom in on the first image. And then when I change the hash mark with a period, switching ID to CLASS, it will zoom in on all the images but it will disperse one type of image. If you need more information to help solve this riddle please let me know.

推荐答案

您似乎需要在脚本中使用 largeimage 属性.

look like you need to use largeimage attribute in script.

$('.img').addimagezoom({
zoomrange: [6, 18],
magnifiersize: [600,600],
magnifierpos: 'right',
cursorshade: true,
cursorshadecolor: 'pink',
cursorshadeopacity: 0.3,
cursorshadeborder: '1px solid red',
    /*8888888 SEE HERE 8888888*/
largeimage: $(this).attr('src') //<-- No comma after last option!
})

小提琴在下面

http://jsfiddle.net/s6TMs/10/

这篇关于jQuery $('#image').addimagezoom,用于从数据库散布的图片的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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