How to fix the Upcoming Events list to remember scroll position on refresh of Internet Explorer browser

Internet Explorer has a known bug that causes the Upcoming Event list to scroll back to the top of the list when the web page is refreshed.  You can insert the following javascript into your web page containing the Upcoming Event list to remedy this problem.

Place the following script at the bottom of your web page containing the Upcoming Events list:

<SCRIPT LANGUAGE="JavaScript">
window.onload = function(){
 document.getElementById("cwucelist").onscroll = SetDivPosition;
 var strCook = document.cookie;
    if(strCook.indexOf("!~")!=0){
  var intStart = strCook.indexOf("!~");
  var intEnd = strCook.indexOf("~!");
        var strVerticalScrollValue = strCook.substring(intStart+2,intEnd);
        document.getElementById("cwucelist").scrollTop = strVerticalScrollValue;
 }
 if(strCook.indexOf("!#")!=0){
  var intStart = strCook.indexOf("!#");
  var intEnd = strCook.indexOf("#!");
        var strHorizontalScrollValue = strCook.substring(intStart+2,intEnd);
  document.getElementById("cwucelist").scrollLeft = strHorizontalScrollValue;
 }
}
function SetDivPosition(){
        var intY = document.getElementById("cwucelist").scrollTop;
        var intX = document.getElementById("cwucelist").scrollLeft;
        document.cookie = "yPos=!~" + intY + "~!";
        document.cookie = "xPos=!#" + intX + "#!";
}
</SCRIPT>



Article ID: 57
Last updated: 18 Feb, 2013
Revision: 1
Website Integration -> How to fix the Upcoming Events list to remember scroll position on refresh of Internet Explorer browser
https://www.calendarwiz.com/knowledgebase/entry/57/