[FIX] Rich:calendar - RF 3.3.1 - Wrong position on IE6
marco.lala Nov 29, 2010 9:21 AMA rich:calendar (on internet explorer 6) is opened always on top-left corner. I write this code to manage the coordinate left and top of calendar reposition it near che calendar icon.
function manageCoordinateIE6(objCalendar, event){
if(navigator.userAgent.indexOf("MSIE 6") != -1){
if(objCalendar != null){
if (!e) var e = window.event;
var clientX = e.clientX;
var clientY = e.clientY;
$(objCalendar.id).style.visibility = 'hidden';
$(objCalendar.id + 'IFrame').style.visibility = 'hidden';
setTimeout(function(){
function updateCoordinate(obj, clientX, clientY){
var defX = clientX - Math.abs($(objCalendar.id).offsetLeft);
var defY = clientY - Math.abs($(objCalendar.id).offsetTop);
$(obj.id).style.left = defX;
$(obj.id).style.top = defY;
$(obj.id + 'IFrame').style.left = defX;
$(obj.id + 'IFrame').style.top = defY;
$(obj.id).style.visibility = 'visible';
$(obj.id + 'IFrame').style.visibility = 'visible';
}
new updateCoordinate(objCalendar, clientX, clientY);
}, "100");
}
}
}
To execute the code it's necessary add this attribute to all calendar. The code will be execute only for IE6.
onexpand="manageCoordinateIE6(this, event)"
I hope that this fix is usefull.