Make a slider with views (?)

1

At the bottom of the site I have a view call:

<?php $this->load->view('frontend/'.$this->domain.'/services/box_crm'); ?>

It is the description of a service: Ileftthecontentoutoffocusduetocustomerprivacy.

Butnowtheclientwantstoaddtheirotherservicesinthesameplace,withaslider,whichlookssomethinglikethis:

I left the content out of focus due to customer privacy .

The question : How can I make this slider calling views instead of images? When I click to pass it loads the next view, and so on. Is it possible to do this?

    
asked by anonymous 06.05.2015 / 16:56

1 answer

1

I solved it as follows:

<script type="text/javascript">

        function simpleSlider(type){
            var sliderActive = $("#slider .sliderActive");
                if(type == 'prev') {
                    var sliderPrev   = sliderActive.prev().length ? sliderActive.prev() : $("#slider li:last");
                    sliderPrev.addClass('sliderActive').fadeIn();
                } else {
                    var sliderNext   = sliderActive.next().length ? sliderActive.next() : $("#slider li:first");
                    sliderNext.addClass('sliderActive').fadeIn();
                }
                sliderActive.removeClass('sliderActive').fadeOut();
            }
        $(function(){
            $("#slider li:first").fadeIn();

        });
    </script>

  <div class="buttons">
<a href="javascript:simpleSlider('prev')"><img src="assets/frontend/img/services/seta_esquerda.png"></a><a href="javascript:simpleSlider('next')"><img src="assets/frontend/img/services/seta_direita.png"></span></a>
</div>

<ul id="slider">
        <li class="sliderActive"><?php $this->load->view('frontend/'.$this->domain.'/services/box_crm'); ?></li>
        <li><?php $this->load->view('frontend/'.$this->domain.'/services/box_landing'); ?></li>
        <li><?php $this->load->view('frontend/'.$this->domain.'/services/box_seo'); ?></li>
        <li><?php $this->load->view('frontend/'.$this->domain.'/services/box_rastreator'); ?></li>

</ul>
    
26.05.2015 / 20:24