Jump to content

[SOLVED]JqZoom first hover


Recommended Posts

At the moment I can't give access to store.

PS version is 1.5.4 and I don't use default template.

 

 

I noticed that it happens only when loading the page my cursor is over the image. If I load the page and cursor isn't over the image, everything works like it has to.

 

Problem is solved. It was something in product.js. I just copied everything from default theme and it works correctly now.

  • Like 1
Link to comment
Share on other sites

  • 3 weeks later...
  • 4 weeks later...

R.Kinkeris, vekia,

In my case, the problem is when I hover on the image and move the mouse over the image It does not show the detail when there is only one product's image.When I move the mouse over the image it shows the entire image without seeing the details.

 

Here is the example that jqZoom is not working correctly (Product with only one image)

Please see the example and move the mouse over the image:

http://newstarfabrics.com/en/chiffon/29-viole.html

 

Here is the example that jqZoom works correctly (Product with tow images)

You should hover first on the small thumbnails back and fort and then hover on the image to see the jqZoom and you will see the details of the images which is good:

http://newstarfabrics.com/en/chiffon/30-crushed-viole.html

 

As I said in my previous post when there are more than one image in the product the jqZoom works correctly. When there is only one image in the product the jqZoom is not working correctly and when we hover over the image, it does not show the detail of the image.

I precise all images in both below scenario are formatted at 600x600.

Link to comment
Share on other sites

Your problem is that first time you hover over the image the jqZoom loads the wrong image.

 

<img class="bigimg" src="http://newstarfabrics.com/54-large_default/viole.jpg">

which naturally is 266x266px instead of

<img class="bigimg" src="http://newstarfabrics.com/54-thickbox_default/viole.jpg">

which is 600x600.

Can't tell you anything else because I'm not so good at these things. Try searching in jqZoom.js or the tpl file for the problem. If you're not using original theme files, try to use the original ones.

Link to comment
Share on other sites

R.Kinkeris,

I use the default theme 1.5.4.1. I need to know exactly what file should I look at and what to modify.

Thank you anyway.

 

yaniv14,

I disabled all CCC and Cache in the BO but it did not resolve the problem.

Thank you

Link to comment
Share on other sites

yaniv14,

I checked in default_gird theme (my theme) and the file 'js/jquery/plugins/jqzoom/jquery.jqzoom.js' does not exist.

In my js folder (in my theme) the folder jquery does not exist.

I am attaching a screen shot of my theme files.

Thank you

post-154019-0-18413100-1369327027_thumb.jpg

Link to comment
Share on other sites

Ok, I will copy the jquery.jqzoom.js from the root folder and then my question is:

Where exactly should I paste the (jquery.jqzoom.js)? What would be the complete path in my theme?

Since I do not have the same JS files managemnet in my default_grid theme, do I need to create the missing folders ( /jquery/plugins/ ) in there?

Thank you

Link to comment
Share on other sites

just paste this inside your existing file

 

//**************************************************************

// jQZoom allows you to realize a small magnifier window,close

// to the image or images on your web page easily.

//

// jqZoom version 1.2

// Author Doc. Ing. Renzi Marco(www.mind-projects.it)

// Released on Dec 05 2007

// i'm searching for a job,pick me up!!!

// mail: [email protected]

//**************************************************************

 

(function($) {

$.fn.jqueryzoom = function(options) {

var settings = {

xzoom: 200, //zoomed width default width

yzoom: 200, //zoomed div default width

offset: 10, //zoomed div default offset

position: "right" //zoomed div default position,offset position is to the right of the image

};

 

if(options)

$.extend(settings, options);

 

var noalt ='';

 

$(this).hover(function() {

var imageRelativeLeft = $(this).get(0).offsetLeft;

var imageLeft = $($(this).get(0)).offset().left;

var imageRelativeTop = $(this).get(0).offsetTop;

var imageTop = $($(this).get(0)).offset().top;

var imageWidth = $(this).get(0).offsetWidth;

var imageHeight = $(this).get(0).offsetHeight;

 

noalt = $(this).attr("alt");

var bigimage = noalt;

$(this).attr("alt", '');

 

if($("div.zoomdiv").get().length == 0)

$(this).after("<div class='zoomdiv'><img class='bigimg' src='"+bigimage+"'/></div>");

 

if(settings.position == "right")

leftpos = imageRelativeLeft + imageWidth + settings.offset;

else

leftpos = imageRelativeLeft - settings.xzoom - settings.offset;

 

$("div.zoomdiv").css({top: imageRelativeTop,left: leftpos});

$("div.zoomdiv").width(settings.xzoom);

$("div.zoomdiv").height(settings.yzoom);

$("div.zoomdiv").show();

 

$(document.body).mousemove(function(e) {

var bigwidth = $(".bigimg").get(0).offsetWidth;

var bigheight = $(".bigimg").get(0).offsetHeight;

var scaley ='x';

var scalex= 'y';

 

if(isNaN(scalex)|isNaN(scaley)) {

var scalex = Math.round(bigwidth/imageWidth) ;

var scaley = Math.round(bigheight/imageHeight);

}

 

mouse = new MouseEvent(e);

 

scrolly = mouse.y - imageTop - ($("div.zoomdiv").height()*1/scaley)/2 ;

$("div.zoomdiv").get(0).scrollTop = scrolly * scaley ;

scrollx = mouse.x - imageLeft - ($("div.zoomdiv").width()*1/scalex)/2 ;

$("div.zoomdiv").get(0).scrollLeft = (scrollx) * scalex ;

});

}, function() {

$(this).attr("alt", noalt);

$("div.zoomdiv").hide();

$(document.body).unbind("mousemove");

$(".lenszoom").remove();

$("div.zoomdiv").remove();

});

}

})(jQuery);

 

function MouseEvent(e) {

this.x = e.pageX

this.y = e.pageY

}

Link to comment
Share on other sites

  • 2 weeks later...

your site still load the 1.5.4.1 jqzoom file so please download this file,

and place the file in your root not themes folder under 'js/jquery/plugins/jqzoom/'

and check if its working, try also hard refresh in your browser to make sure the browser is getting the file again from the server and not from cache.

 

let me know

Link to comment
Share on other sites

Hmmmm...... I can see its loading the new file but now working at all, console show 404 on image.

reverse back to your previous file that at least showed the image when hover, and meanwhile i will try to check it.

For now keep all CCC as normal (that way is easier to inspect your site).

 

Also maybe you want to open a new topic so other members can help, because not allot of members will open a topic that says SOLVED on the title.

Edited by yaniv14 (see edit history)
Link to comment
Share on other sites

  • 2 weeks later...
Your problem is that first time you hover over the image the jqZoom loads the wrong image.
 

which naturally is 266x266px instead of

 

which is 600x600. Can't tell you anything else because I'm not so good at these things. Try searching in jqZoom.js or the tpl file for the problem. If you're not using original theme files, try to use the original ones.

 

I have the very same problem. I've replaced both products.tpl and jqzoom.js files and it doesn't work. Do you know which file sets which picture is used first in the product page ?

Link to comment
Share on other sites

  • 2 months later...
×
×
  • Create New...