Hello!

Could you please tell me, how to make auto scroll events per day. If i have several events at one day, and i need it to scroll.

thank you!

Comments

ula888’s picture

The slider to connect like this:

1. in the info file connected to a library of scripts[]= js/jquery-1.7.2.min.js

2. in the template calendar calendar-month-col.tpl.php wrote the following

<?php
/**
 * @file
 * Template to display a column
 * 
 * - $item: The item to render within a td element.
 */
$id = (isset($item['id'])) ? 'id="' . $item['id'] . '" ' : '';
$date = (isset($item['date'])) ? ' data-date="' . $item['date'] . '" ' : '';
$day = (isset($item['day_of_month'])) ? ' data-day-of-month="' . $item['day_of_month'] . '" ' : '';
$headers = (isset($item['header_id'])) ? ' headers="'. $item['header_id'] .'" ' : '';
?>

<td <?php print $id?>class="<?php print $item['class'] ?>" colspan="<?php print $item['colspan'] ?>" rowspan="<?php print $item['rowspan'] ?>"<?php print $date . $headers . $day; ?>>
<div id="slider-wrap">
    <div id="slider">
    <?php print $item['entry'] ?>
</div>
</div>

</td>
<script>
var hwSlideSpeed = 700;
var hwTimeOut = 3000;
(function ($) {
$(document).ready(function(e) {
    $('.slide').css(
        {"position" : "absolute",
         "top":'0', "left": '0'}).hide().eq(0).show();
    var slideNum = 0;
    var slideTime;
    slideCount = $("#slider .slide").size();
    var animSlide = function(arrow){
        clearTimeout(slideTime);
        $('.slide').eq(slideNum).slideUp(hwSlideSpeed);
        if(arrow == "next"){
            if(slideNum == (slideCount-1)){slideNum=0;}
            else{slideNum++}
            }
        else if(arrow == "prew")
        {
            if(slideNum == 0){slideNum=slideCount-1;}
            else{slideNum-=1}
        }
        else{
            slideNum = arrow;
            }
        $('.slide').eq(slideNum).fadeIn(hwSlideSpeed, rotator);
        $(".control-slide.active").removeClass("active");
        $('.control-slide').eq(slideNum).addClass('active');
        }
     
    var pause = false;
    var rotator = function(){
    if(!pause){slideTime = setTimeout(function(){animSlide('next')}, hwTimeOut);}
            }
    $('.slide').hover(    
        function(){clearTimeout(slideTime); pause = true;},
        function(){pause = false; rotator();
        });
    rotator();
	
});
})(jQuery);
</script>

4. in the template contents of the day calendar calendar-item.tpl.php

<div class="slide">
    <?php print theme('calendar_stripe_stripe', array('item' => $item)); ?>

      <?php foreach ($rendered_fields as $field): ?>
   
        <?php print $field; ?>
      <?php endforeach; ?>

</div>

5. cleared the cache

the slider earned ))

there is a question:

What and where to register..to..if in the bottom of one event...slider is not spinning? and how to make so that there was no white space between events?

now he's turning the event (one or several, depending how many of them at the bottom) then comes the white box..then again the events.

Neslee Canil Pinto’s picture

Issue summary: View changes
Status: Active » Closed (outdated)