nyroDev/nyroModal — Issue #142: Opera older than 11 can’t get width content of .nyroModalCont
Author: c-o-s
Created: 2011-10-18 12:37:15+00:00
State: open

At first time i was glad to use your plugin. But there are more to do.....
In an Opera 10.51 existing problem to get width (i think its for all version less than 11)

----------------------------------------------------Code start----------------------------------------------------
/*
* nyroModal v2.0.0
*
* Image filter
*
* Depends:
* - filters.link
*
* Before: filters.data
*/
// ....... code before
size: function(nm) {
// My prepended code
// this helps Opera to parse width of image,
// But when resize() launching size of image are incorect :( maybe you can find where to fix that to
var t = new Image();
t.src = nm.elts.hidden.find('img').attr('src');
nm.sizes.initW = nm.sizes.w = t.width;

// Your code
if (nm.sizes.w != nm.sizes.initW || nm.sizes.h != nm.sizes.initH) {
var ratio = Math.min(nm.sizes.w/nm.sizes.initW, nm.sizes.h/nm.sizes.initH);
nm.sizes.w = nm.sizes.initW * ratio;
nm.sizes.h = nm.sizes.initH * ratio;
}
var img = nm.loading ? nm.elts.hidden.find('img') : nm.elts.cont.find('img');

img.attr({
width: nm.sizes.w,
height: nm.sizes.h
});
},
// ....... code after

/*
* nyroModal v2.0.0
*
* Iframe filter
*
* Depends:
* - filters.link
*
* Before: filters.formFile
*/
// ....... code before
load: function(nm) {
// Your code
nm.store.iframe = $('');
nm._setCont(nm.store.iframe);

// My apended code
// Opera beyond 11 still cant parse width, so i placed an static width far ALL iframes on my project...
// But its good to be variable
nm.sizes.w = 813;
},
----------------------------------------------------Code end----------------------------------------------------
Sorry for my bad English, still didn’t learn it well.