Php 如何在JQuery脚本中解除绑定JQZOOM?
我现在有这个脚本,当缩略图被更改时,它会更改图像。然后我想将JQZOOM添加到新图像中。然而,如果我把它放在Onclick事件中,你点击它的次数越多,它就会变得越来越慢。。。我猜是因为它运行多个实例 是否有方法将JQZOOM从某个对象解除绑定,然后重新绑定到其他对象 下面是我目前的jquery:Php 如何在JQuery脚本中解除绑定JQZOOM?,php,jquery,Php,Jquery,我现在有这个脚本,当缩略图被更改时,它会更改图像。然后我想将JQZOOM添加到新图像中。然而,如果我把它放在Onclick事件中,你点击它的次数越多,它就会变得越来越慢。。。我猜是因为它运行多个实例 是否有方法将JQZOOM从某个对象解除绑定,然后重新绑定到其他对象 下面是我目前的jquery: var options = { zoomWidth: 400, zoomHeight: 325, xOffset: 25, yOffset: 0, positio
var options = {
zoomWidth: 400,
zoomHeight: 325,
xOffset: 25,
yOffset: 0,
position: "right",
lens: true,
zoomType: "reverse",
imageOpacity: 0.5,
showEffect: "fadein",
hideEffect: "fadeout",
fadeinSpeed: "medium",
title: false
};
$('.jqzoom').jqzoom(options);
$('.single-zoom-image').click ( function () {
$('#bigProductImage').attr("src", $(this).attr("zoom"));
$('.jqzoom').attr("href", $(this).attr("extrazoom"));
});
如果有人能帮助我,请提前感谢
干杯 这可以通过以下方式完成:
$(document).ready(function(){
var options = {
zoomWidth: 300,
zoomHeight: 200,
xOffset: 30,
yOffset: 0,
position: 'right',
title: false,
showPreload: false
};
//Handle clicking on the thumbnails, swap the mainimage and recycle the zoomer
$('.seemore').bind('click', function(e) {
e.preventDefault();
$('.jssProductFullImage').attr('src', $(this).attr('href'));
$('.zoomer').attr('href', $(this).attr('href') );
//Recall the zoomer to update the page
$('.zoomer').trigger('changeimage');
});
$('.zoomer').jqzoom(options);
});
修改其他鼠标功能所在的jqzoom1.0.1.js(第90行附近)
按如下方式调用缩放器:
$(document).ready(function(){
var options = {
zoomWidth: 300,
zoomHeight: 200,
xOffset: 30,
yOffset: 0,
position: 'right',
title: false,
showPreload: false
};
//Handle clicking on the thumbnails, swap the mainimage and recycle the zoomer
$('.seemore').bind('click', function(e) {
e.preventDefault();
$('.jssProductFullImage').attr('src', $(this).attr('href'));
$('.zoomer').attr('href', $(this).attr('href') );
//Recall the zoomer to update the page
$('.zoomer').trigger('changeimage');
});
$('.zoomer').jqzoom(options);
});
这可以通过以下方式完成:
$(document).ready(function(){
var options = {
zoomWidth: 300,
zoomHeight: 200,
xOffset: 30,
yOffset: 0,
position: 'right',
title: false,
showPreload: false
};
//Handle clicking on the thumbnails, swap the mainimage and recycle the zoomer
$('.seemore').bind('click', function(e) {
e.preventDefault();
$('.jssProductFullImage').attr('src', $(this).attr('href'));
$('.zoomer').attr('href', $(this).attr('href') );
//Recall the zoomer to update the page
$('.zoomer').trigger('changeimage');
});
$('.zoomer').jqzoom(options);
});
修改其他鼠标功能所在的jqzoom1.0.1.js(第90行附近)
按如下方式调用缩放器:
$(document).ready(function(){
var options = {
zoomWidth: 300,
zoomHeight: 200,
xOffset: 30,
yOffset: 0,
position: 'right',
title: false,
showPreload: false
};
//Handle clicking on the thumbnails, swap the mainimage and recycle the zoomer
$('.seemore').bind('click', function(e) {
e.preventDefault();
$('.jssProductFullImage').attr('src', $(this).attr('href'));
$('.zoomer').attr('href', $(this).attr('href') );
//Recall the zoomer to update the page
$('.zoomer').trigger('changeimage');
});
$('.zoomer').jqzoom(options);
});
为我做了这项工作
为我做了这项工作