Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix errors on IE8 because of img.style.left/top not available #11

Closed
wants to merge 1 commit into from
Closed

Conversation

cmwelsh
Copy link

@cmwelsh cmwelsh commented Nov 18, 2012

Hi there. Nice plugin. I fixed an error on IE8 real quick for you with this patch. I will send you a link to my site when it launches - your plugin works really well. Thanks.

@jackmoore
Copy link
Owner

Thanks. What was the problem with using element.style to set the properties?

@cmwelsh
Copy link
Author

cmwelsh commented Nov 18, 2012

This was the error:

Error: Invalid procedure, call or argument

@cmwelsh
Copy link
Author

cmwelsh commented Nov 19, 2012

This was sort of my fault. I am doing some weird stuff. Here is the code I wrote to turn on your plugin and never turn it off:

$thumbnail.on('click', function (e) {
    e.preventDefault();
    $full.fadeIn();

    // fake hover start
    $full.find('.zoomImg').mouseenter();
    // disable hover end
    $full.find('.zoomImg').off('hover');

    // load initial position
    var fakeEvent = jQuery.Event("mousemove");
    fakeEvent.pageX = e.pageX;
    fakeEvent.pageY = e.pageY;
    $.event.handle.call($full.find('.zoomImg').get(0), fakeEvent);
});

This line caused the error:

    $full.find('.zoomImg').mouseenter();

e.pageX and e.pageY were undefined in the handler triggered by this line in IE8.

@cmwelsh
Copy link
Author

cmwelsh commented Nov 21, 2012

I am going to retract this pull request and just write a patch that adds the feature I need directly, so I don't need to do any of the crazy gymnastics in the above example. It will allow the user to trigger the zoom on and off manually with code. If I forget to submit a pull request for my fork, forgive me - things are crazy busy.

@cmwelsh cmwelsh closed this Nov 21, 2012
@cmwelsh
Copy link
Author

cmwelsh commented Dec 12, 2012

Here is the page where I am using your plugin:

http://ranchroadboots.com/products/boots/shelter-half-diamond-2/

Just thought you might want to see. Thanks for the code!

@jackmoore
Copy link
Owner

The site looks great, thanks for sharing that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants