Menu
Welcome, Guest
Username: Password: Secret Key Remember me
Welcome to the Developer forum!
Get all your questions answered here. Learn to integrate calendar in your application.
  • Page:
  • 1

TOPIC: Auto Scroll down to the earliest event in the grid

Auto Scroll down to the earliest event in the grid 14 years 4 months ago #223

  • Dmitri
  • Dmitri's Avatar Topic Author
  • Offline
  • Fresh Boarder
  • Fresh Boarder
  • Posts: 2
  • Thank you received: 0
We have utilized some methods: “show activities from earliest event” . It gives users ability to see earliest event at first loading of the calendar. The user doesn’t have to scroll down to check out for the first event if it’s appeared later afternoon and not seen when calendar is just loaded. The method will do it for user.
function cb_loadCalendarEvents(list){
ical.render(list);
var top=findEarliestEvent(list,howmany); //howmany - is a String //parameter of how many people
//selected for the scheduler(passed with link)
var grid=jQuery("#calbodyContainer").get(0);
grid.scrollTop=(top==670)?grid.scrollHeight:top;
}
/*----Find the earliest event to make a grid offset
*/
var evId; var evTop;
function findEarliestEvent(vents,howmany){
evTop=670;//<-full size of the grid
for(var i=0; i<parseInt(howmany); i++){
for(var j in vents.events){
var number='#event'+vents.events[j].eventId; //”eventId” includes numbers only
evId=eval('jQuery("'+number+'").get(0)');
var vSt=parseInt(evId.style.top.substring(0,evId.style.top.indexOf('px')),10); //get digits only
evTop=(evSt<evTop)?evSt:evTop;
}
}
return evTop;
}

Please Log in to join the conversation.

  • Page:
  • 1
Time to create page: 0.066 seconds
Powered by Kunena Forum

LATEST IN FORUM

  • No posts to display.

ABOUT US