Copied to clipboard

Flag this post as spam?

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


  • Owen Hope 119 posts 140 karma points
    Dec 09, 2011 @ 02:01
    Owen Hope
    0

    Issues with Slider

    Hi - sorry for the other post...won't let me delete it !

    I implemented Nivo into my 4.7 Umbraco installation at http://regulus.mountaininteractive.ca/

    Now, I changed the design of it quite a bit, but i've noticed a few problems.

    1) The Image and the Caption are not in sync. Teal = Slide 1 -- Purple = Slide 2 -- Yellow  = Slide 3 if you watch the captions change must faster than images, however the images eventually catch up.

    2) I modified the Nivo Media Type to add a "Title" as a textstring. Now in the Macro code I modified it like so.

    <div id="@nodes.Name" class="nivoSlider">
                @foreach (dynamic img in nodes.Children)
                
                   if (img.NodeTypeAlias != "NivoSliderImage")
                    {
                        continue;
                    }
                                    
                    System.Text.StringBuilder htmlNode new System.Text.StringBuilder();
                    
                    if (img.HasValue("nivoSliderUrl"))
                    {
                        dynamic destNode new DynamicNode(img.nivoSliderUrl);
                        htmlNode.Append("<a href=\""+destNode.NiceUrl+"\" >");                    
                    }
                 
                    htmlNode.Append("<h2>" img.nivoTitle "</h2>");
                    htmlNode.Append("<img src=\""+img.umbracoFile+"\" alt=\""+img.Name+"\"");
                    
                    if (img.HasValue("nivoSliderCaption"))
                    {
                        htmlNode.Append(" title=\"#"+img.Name+"\"");                                   
                    }
                    
                    htmlNode.Append("/>");
                    
                    if (img.HasValue("nivoSliderUrl"))
                    {
                        htmlNode.Append("</a>");
                    }

                    htmlNode.AppendLine();
                    @Html.Raw(htmlNode.ToString());                
                }
      
            </div>
            
        foreach (dynamic img in nodes.Children)
        {
            if (img.HasValue("nivoSliderCaption"))
            {
                    <div id="@img.Name" class="nivo-html-caption">
                        @Html.Raw(img.nivoSliderCaption)
                    </div>                          
            }

        }

    If you notice that the Slider Title is not changing as it should (They are labled "Slider #1" "Slider #2" "Slider #3")

    Any help would be much appreciated.

  • Owen Hope 119 posts 140 karma points
    Dec 09, 2011 @ 21:13
    Owen Hope
    0

    I was able to solve #1 problem with the slider images not syncing with the captions. I had 'random' effect selected and I switched to 'fade' or actually any effect but random this problem was resolved.

    I am still trying to figure out #2 ... it still will only display the title from the First slide, not refreshing to the next.

     

    Cheers

Please Sign in or register to post replies

Write your reply to:

Draft