Copied to clipboard

Flag this post as spam?

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


  • Stephanie Nicolaou 33 posts 91 karma points
    Feb 03, 2015 @ 14:05
    Stephanie Nicolaou
    0

    Banners using CarouFedSel

    Hi all,

    I've followed the instructions provided by Carlos (below) however my banner images are displayed statically, one below the other on my site. Please can you provide any advice on this as I don't think it is picking up the javascript?

    http://carlosmartinezt.com/2014/06/umbraco-7-and-mvc-practical-examples-part-2/

    What I have done:

    • Added the Media Type, 'Banner' with the properties
    • Added a banner property to the home document type properties
    • Uploaded the banners in the media banner folder
    • Added the homepageManyBanners partial view
    • Inserted the render tag into the homepage layout
    • Copied the javascript file to the Scripts folder

    I've followed the instructions exactly to no avail. Please can someone who used this successfully advise?

     

    Regardsm

    Steph

  • Damian Green 452 posts 1433 karma points
    Feb 03, 2015 @ 15:18
    Damian Green
    0

    Hi Steph,

    Are you getting any errors in the console?

    Deffo sounds like its not picking up the js or the jquery selector is wrong to initiate the slider.

    Damian

  • Damian Green 452 posts 1433 karma points
    Feb 03, 2015 @ 15:21
    Damian Green
    0

    Did you see this comment:

    You mentioned to paste "jquery.carouFredSel-6.2.1.js" but later on in your code you've included "jquery.carouFredSel-6.2.1-packed.js", so it won't work out of the box.

  • Stephanie Nicolaou 33 posts 91 karma points
    Feb 03, 2015 @ 16:00
    Stephanie Nicolaou
    0

    Hi Damian,

    I got it to work, I just had to insert the script tags into the head of the layout and it picked up on the js file:

    <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" type="text/javascript"></script>
    <script src="jquery.carouFredSel.js" type="text/javascript"></script>

    Only problem now is that in Internet Explorer it is nicely centered and in Firefox the banner starts to be displayed completely off to the right of the page, starting from the last navigational button.

    I think this may be css related but not entirely sure why it works in IE and not firefox.

    Regards,

    Steph

  • Damian Green 452 posts 1433 karma points
    Feb 03, 2015 @ 16:28
    Damian Green
    0

    Hi

    Why doesn't that surprise me. IE/FF/Chrome all have their quirks! :o/

    In IE a lot of the time, with images, it is down to not having sizes specified for the image and so it doesnt know how to render them properly.

    Also if you have any errors in the html some browsers handle it better than others.

    Check your opens and closes on divs, lists etc. too

    Run it through a W3c tool to check your html:

    http://validator.w3.org/

    Damian

  • Martin 114 posts 313 karma points
    Feb 03, 2015 @ 22:42
    Martin
    0

    Hi,

    Perhaps you already tried it, but have you checked out http://docs.dev7studios.com/jquery-plugins/caroufredsel ? There are some good tips, for example, to ensure the plugin is able to measure the correct sizes, always use display: block; for the items. In a horizontal carousel, you should also make the items float: left;.

    Also, it is a good idea to add

    #carousel {             
        width: 870px;       
        height: 175px;      
        overflow: hidden;
    }
    

    to prevent "F.O.U.C.".

    Good luck, Martin

  • Stephanie Nicolaou 33 posts 91 karma points
    Feb 05, 2015 @ 12:22
    Stephanie Nicolaou
    0

    Hi Martin,

    Thanks for your advise. I'll have to experiment with the CSS sometime, we had a lot of those parameters with slightly different values. What fixed it was very odd, I just added an empty set of div tags above it and then it displayed in the center for both browsers. It works so we will keep them in for now but we will have to have a code review to find out a better way of managing it.

    Thanks.

    Steph

Please Sign in or register to post replies

Write your reply to:

Draft