I have a page containined in an iFrame (With an external html page embedded in it) this page has a form and upon mouseover of the form submit button it calculates the hidden values of the form before submission.
I am in addition using the smoothzoom library in the form (http://codecanyon.net/item/smooth-zoom-pan-jquery-image-viewer/full_screen_preview/511142).
An example calculation is offset left of image calculated against the offset left of crop view.
I have inspected the elements in both chrome and firefox.
On mouseover all of the hidden fields update in firefox.
When as in chrome only two of them update. The X and Y.
Here is the jQuery I am using.
var hovered = false;
$(function(){
$('#image').smoothZoom({
width: 270,
height: 270,
zoom_MAX: 600,
animation_SPEED: 0.001,
animation_SMOOTHNESS: 0,
initial_ZOOM: '100',
initial_POSITION: '0 0'
});
$('#headerImageCont').hover(function(){
hovered = true;
},function(){
hovered = false;
});
$(window).bind("mousewheel", function(event, delta){
if (hovered === true){
return false;
}
});
$('#saveButton').mouseover(function(){
$('#x').val(-$('#image').position().left); //needs to be inverted
$('#y').val(-$('#image').position().top); //needs to be inverted
$('#ScaleX').val($('#image').width() / 500);
$('#ScaleY').val($('#image').height() / 423);
$('#Scale').val($('#image').width() / 500 * 100);
$('#target_width').val($('#headerImageCont').width());
$('#target_height').val($('#headerImageCont').height());
$('#actual_width').val($('#image').width());
$('#actual_height').val($('#image').height());
});
});