I developed the plugin ascensor.js (http://kirkas.ch/ascensor/)
After rewriting it completely (whitout scrollto plugin) i experience some bug on the resize fonction.
When you do it, there is some bounce effect (chrome) and you can see small part of other floor, i know that every browser have different resize effect, but i’m wondering if there’s a way to fix it.
Resize effect:
Chrome/Safari/Firefox: small bounce and see other floor
Opera: no resize effect until click up
Here the full plugin : http://kirkas.ch/ascensor/js/jquery.ascensor.js
And here the part about the resize fonction:
function resizeFloor(){
var WW=$(window).width();
var WH=$(window).height()
if(params.Direction=='y'){$(node).stop().animate({scrollTop:(floor-1)*WH},1);}
if(params.Direction=='x'){$(node).stop().animate({scrollLeft:(floor-1)*WW},1);}
if(params.Direction=='chocolate'){
var target = AscensorMap[StageOn-1].split('|');
$(node).stop().animate({
scrollLeft:(target[1]-1)*WW,
scrollTop:(target[0]-1)*WH
},1);
}
$(node).height(WH).width(WW).children(params.ChildType).each(function(){
$(this).height(WH).width(WW);
});
if(params.Direction=='x'){
$(node).children().css('position','absolute');
$(node).children().each(function(index){$(this).css('left',index*WW);})
}
if(params.Direction=='chocolate'){
$(node).children(params.ChildType).each(function(index){
var CoordName = AscensorMap[index].split('|');
$(this).css({'position':'absolute', 'left':(CoordName[1]-1)*WW, 'top':(CoordName[0]-1)*WH});
});
}
}
Also i’m quite new in JS development, so if you have any advice about syntax or critic about the system, i’m fully open.
Thanks
I finish to find by myself, instead of
I should use