Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Phil Eagles 1 post 21 karma points
    Feb 21, 2014 @ 12:04
    Phil Eagles
    0

    Method to adding Play/Pause button on an image gallery

    Hi, this is the current code I have:

    @inherits umbraco.MacroEngines.DynamicNodeContext

    @{
        var gallery = Model.MediaById(Model.Gallery);
    }

    @if (Model.HasValue("Gallery"))
    {
        var galleryImages = gallery.Children ?? gallery;
        <div class="gallery">
            @if (galleryImages.Count() > 1)
            {
                <a href="#" class="gallery-control gallery-prev" data-direction="-1">Previous</a>
                <a href="#" class="gallery-control gallery-next" data-direction="1">Next</a>
                <ul class="inner">
                    @foreach (var image in galleryImages)
                    {
                        <li><img src="@image.umbracoFile?w=892" alt="@image.Name" /></li>
                    }
                </ul>
            }
            else
            {
                <ul class="inner">
                    <li><img src="@gallery.umbracoFile?w=892" alt="@gallery.Name" /></li>
                </ul>
            }
        </div>
    }

    Which has back and next buttons but how do I add a working play/pause button?

    Thanks

Please Sign in or register to post replies

Write your reply to:

Draft