jqzoom Обновление картинки
Здравствуйте!
Использую модуль увеличения изображений jqzoom. Изображение обновляется каждые несколько минут с помощью ajax. При этом устанавливается новое src изображения и новый href ссылки. Модуль jqzoom не обновляет изображение, хотя заново вызывается при каждом обновлении картинки. Что делать? Как обновлять картинку в jqzoom? magiczoom и cloud zoom также не обновляют картинку. |
функция Largeimage()
в подключаемой библиотеке jqzoom есть функция Largeimage.
как её вызвать для обновления данных? (то есть url картинки заменить на новый)
/*========================================================,
| LargeImage
|---------------------------------------------------------:
| The large detailed image
`========================================================*/
function Largeimage() {
var $obj = this;
this.node = new Image();
this.loadimage = function (url) {
//showing preload
loader.show();
this.url = url;
this.node.style.position = 'absolute';
this.node.style.border = '0px';
this.node.style.display = 'none';
this.node.style.left = '-5000px';
this.node.style.top = '0px';
document.body.appendChild(this.node);
this.node.src = url; // fires off async
};
this.fetchdata = function () {
var image = $(this.node);
var scale = {};
this.node.style.display = 'block';
$obj.w = image.width();
$obj.h = image.height();
$obj.pos = image.offset();
$obj.pos.l = image.offset().left;
$obj.pos.t = image.offset().top;
$obj.pos.r = $obj.w + $obj.pos.l;
$obj.pos.b = $obj.h + $obj.pos.t;
scale.x = ($obj.w / smallimage.w);
scale.y = ($obj.h / smallimage.h);
el.scale = scale;
document.body.removeChild(this.node);
$('.zoomWrapperImage', el).empty().append(this.node);
//setting lens dimensions;
lens.setdimensions();
};
this.node.onerror = function () {
alert('Problems while loading the big image.');
throw 'Problems while loading the big image.';
};
this.node.onload = function () {
//fetching data
$obj.fetchdata();
loader.hide();
el.largeimageloading = false;
el.largeimageloaded = true;
if (settings.zoomType == 'drag' || settings.alwaysOn) {
lens.show();
stage.show();
lens.setcenter();
}
};
this.setposition = function () {
var left = -el.scale.x * (lens.getoffset().left - smallimage.bleft + 1);
var top = -el.scale.y * (lens.getoffset().top - smallimage.btop + 1);
$(this.node).css({
'left': left + 'px',
'top': top + 'px'
});
};
return this;
};
$(el).data("jqzoom", obj);
|
поменять картинку
проблема такая же один в один неужели ни кто не знает как ее решить?
нашел решение http://www.codeharmony.ru/materials/115 |
egik,
1. прописать ссылке атрибут rel с новыми параметрами ссылка на большое фото и маленькое фото; 2.вытащить из ссылки api; 3.с помощью api прoинициализировать ссылку; если непомогло найти более современный zoom с расширенными возможностями или в раздел работа |
Цитата:
|
| Часовой пояс GMT +3, время: 08:51. |