Click here to Skip to main content
15,889,909 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
My intro page is using swiperslider Framework7. I want to put "Done" button on the same place as swiper-arrow-next, but with the same features as arrow-next. "Done" should be replace with exact same arrow like swiper-arrow-next (the same style and size) and it should appear only in the end of slider, so when clicked should take me to login.
There is complete html, css and js code;

HTML
    <div data-page="intro" class="page navbar-fixed toolbar-fixed">

    <!-- Content-->
    <div class="page-content">
        <!-- Slider container -->
        <div class="swiper-container">
            <!-- Slides wrapper -->
            <div class="swiper-wrapper">
                <!-- Slides -->
            </div>
            <!-- Pagination, if required -->
            <div class="swiper-pagination"></div>

            <div class="swiper-button-prev"></div>
            <div class="swiper-button-next"></div>

            <!-- Skip/Done Buttons -->
            <span class="intro-button skip"><a href="login.html">Skip</a></span>
            <span class="intro-button done"><a href="login.html">Done</a></span>
        </div>
        <!-- /End of Slider container -->
    </div>

</div>



          div[data-page=intro] {
        .page-content {
            padding-top: 0 !important;
        }

        .swiper-container {
            height: 100%;
        }

        .swiper-slide {
            position: relative;
            width: 100%;
            height: 100%;
            background: #fff;
            text-align: center;

            img {
                max-width: 80%;
                margin-top: 20vh;
            }

            span {
                display: block;
                width: 100%;
                margin-top: 40px;
                padding: 0 15%;
                text-align: center;
                font-size: 20px;
                color: $color-brand-1;
            }
        }

        .swiper-button-next {
            > .done {
                display: none;
            }

            &.swiper-button-disabled {
                background-image: none;
                opacity: 1;
                pointer-events: auto;
                & + .intro-button + .done {
                    display: block;
                }
            }
        }

        .intro-button {
            position: absolute;
            bottom: 10px;
            font-size: 20px;
            color: $color-brand-1;
            cursor: pointer;
            z-index: 999;
            &.skip {
                left: 20px;
            }
            &.done {
                display: none;
                right: 20px;
            }
        }
    }

        .touchevents {
            .swiper-button-next,
            .swiper-button-prev {
                display: none;
            }

            .swiper-button-next.swiper-button-disabled {
                display: block;
            }
        }


   <pre lang="Javascript"> (function ($, document, window) {

                'use strict';

                // Now we need to run the code that will be executed only for Feature page.
                myApp.onPageInit('intro', function (page) {

                    var makeApiRequest = window.makeApiRequest;

                    // Display splash screen
                    splashScreen();

                    // Initiate Slider
                    makeApiRequest('sliders', null, 'GET', true).done(buildSlider).done(initiateSlider);

                    // build slider
                    function buildSlider(slidesArr) {
                        var slider = slidesArr.sliders;

                        var sliderHTML = '';

                        $.each(slider, function (i) {
                            sliderHTML += '<div class="swiper-slide">';
                            // images need to have proportion of 700x907
                            sliderHTML += '<img src="' + slider[i].image + '" />';
                            sliderHTML += '<span>' + slider[i].description + '</span>'
                            sliderHTML += '<div class="preloader"></div>';
                            sliderHTML += '</div>';
                        });

                        $('.swiper-wrapper').html(sliderHTML);
                    }

                    // show splash screen for 2 seconds
                    function splashScreen() {
                        var splashHTML = '<div class="splash-wrapper"><img src="images/splash.png" class="splash" /></div>';
                        $('#wrapper').prepend(splashHTML);

                        var hideSplash = function () {
                            $('.splash-wrapper').remove();
                        };

                        setTimeout(hideSplash, 2000);
                    }

                    // initiate framework7 slider
                    function initiateSlider() {

                        // initiate slider
                        var mySwiper = new Swiper('.swiper-container', {
                            speed: 400,
                            preloadImages: false,
                            lazyLoading: true,
                            pagination: '.swiper-pagination',
                            paginationHide: false,
                            paginationClickable: true,
                            nextButton: '.swiper-button-next',
                            prevButton: '.swiper-button-prev'
                        });

                        // disable swiping on desktop
                        if (!myApp.support.touch) {
                            $('.swiper-container').addClass('swiper-no-swiping');
                        }


                      }

                    });

        }(jQuery, document, window));




What I have tried:

I'm getting lost when trying to change done to be an arrow... and position of it
Posted
Updated 13-Sep-16 9:01am
Comments
Afzaal Ahmad Zeeshan 13-Sep-16 15:42pm    
Every framework has options to update and modify the look and feel of your application. Which framework are you talking about?
Karthik_Mahalingam 13-Sep-16 21:51pm    
Hi AAZ
you have got a reply, below.
Member 12737957 13-Sep-16 15:46pm    
it's framework7. That's what I want. That intro-button done becomes exactly like arrow-next. But I don't know how. When I use font awesome, it's not the same arrow, it's thicker ...
Karthik_Mahalingam 13-Sep-16 21:51pm    
Always use  Reply   button to post comments/query to the concerned user, so that the user gets notified and respond to your text.
Afzaal Ahmad Zeeshan 14-Sep-16 4:31am    
If that is thicker, maybe you are using font-weight: bold; in the CSS style or something like that. Since we don't know where that style comes from, it is hard to guide you on this.

1 solution

I think you are looking for font awesome icons. Try using it with bootstrap.
Font Awesome Icons[^]

The website has explanation on how to use it.
 
Share this answer
 
Comments
Member 12737957 13-Sep-16 15:02pm    
Ok, but I want when the last slide appears, that DONE becomes the same as next-arrow. on that same place and the same size...like it's not the end of the slide and than that next-arrow goes to login url

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900