Slider in right column not working correctly

From a previous post, I have taken Ralph’s suggestion of creating 2 columns for the main area of my new site. Left column holds the logo and the nav and the right column holds the slider and the content.

I have placed the slider at the top of the right column but the nav below it is all the way at the bottom of the page below the text. I also need about 10 to 20 px at the top as a margin. I am not sure what went wrong. I have tried placing an overflow: hidden, but that didn’t work. I do have a set height and width. I don’t now if that is messing things up. I am using images from a client’s site for my slider just to test it.

The site is up at http://foxdencreations.com/new_site/index.html.

It should look similar to the prototype below.

Hi,

Your list elements inside .slides are floated so you need to contain them within .slides.

e.g.


.slides{overflow:hidden;zoom:1.0}
/* or use your preferred float containing technique*/

The slide navigation should now slide up underneath the slides although you may have to move it into exact position as required.

e.g.


.slides{
overflow:hidden;
zoom:1.0;
}

.flexslider{
padding:20px 0 50px;
margin:0 auto;
}

.flex-control-nav {
   margin: 105px 0 0;
}
.content{margin-top:0}

Why is the header an empty div?

You could simply have made space with padding unless of course you are putting some content into that fixed height header later on.

The height on the left column is a bad move and you very rarely would put height on columns like that as you never know how high the right column is going to be and it will vary from browser to browsers and user text preference sizes etc. To make the columns equal simply wrap a div around both left and right floated columns (remember to contain the floats) and then repeat the left background on this new container and it will always match the height of the columns. In fact you need to amalgamate your right column image and the [URL=“http://foxdencreations.com/new_site/images/nav_bg.jpg”]left column image into one single repeatable image and then repeat it on that new container so that it paints both columns at the same time.

Your right column image is 2177px high and weights in at a massive 1957k!! That’s more than the total of most small sites whole code. That image should be optimised down to about 20k - 30k. It doesn’t need to be 2177px tall as you can make it repeat at a much smaller height and then optimise it down as low as possible.

Thank you for your response, Paul. I will add padding to the header as I want there to be space between the top of the page and where the left and right columns start.

The reason I went for a fixed height on both columns was I wanted the backgrounds to match up as in the Fireworks prototype instead of staggered as I am experiencing when content is added.

I will work with your suggestions and see if I can make this more user-friendly. First drafts are almost always rough and you have to work through the problems to get the best possible results.

OK I am struggling with the background for the nav and content. The content area is transparent and has a 1px border so png has to be used. The nav area has to be matched exactly so there isn’t a noticeable difference in the graphic. I tried “slicing” the top middle and bottom. The top comes in at 24.9 kb, the middle comes in at 772 kb and the bottom comes in at 19.5 kb. The middle seems to be the problem or maybe all three. The pattern is different on the striped nav area and must match exactly with the footer divider. Any ideas what I can do here? I will upload the images that I am using so maybe others can play around and see what they can do.

http://foxdencreations.com/new_site/images/content_bg.png

http://foxdencreations.com/new_site/images/shutterstock_68561788.jpg

Hi,

Sorry I’ve been away today but I’ll try and have a look at this tomorrow (unless someone else wants to jump in).

772k is still far to unreasonable a size to use so you will need to re-think this through a little and compromises will need to be made. The stock answer is that although you can draw it in photoshop it doesn’t means its viable on the web.:slight_smile: The web needs to work with fluid mediums and avoid trying to match fixed height images to content so more subtle approaches need to be made to make a more robust layout.

Not all things are possible but with a few compromises you should be able to get close but will involve reducing and slicing the images carefully and indeed repeating the same image over some nested elements to get the effect you want. I;ll try and fins some time tomorrow to give a better answer :slight_smile:

I’m diddling with the images a bit. I think I can come up with something that will work without requiring gargantuan images. Will let you know. :slight_smile:

The demo page shows the content area longer than the left menu. What should the page look like if there is not enough content to reach that length? Is the brown content box supposed to always end at the bottom of the menu or lower? or not?

The image with the greatest byte-size (85K) is currently the Shutterstock image with the green columns. Interestingly, it is probably the least visible. Would you consider making a repeatable image out of a shorter slice (or compressing the image vertically) instead of using the entire full-sized image?

Hi ronpat - I don’t use the entire image. I had compressed it to the left to get narrower columns. It has to match the bottom divider on the left so it looks seamless. Hope that helps.

Also left and right columns should be same height as far as backgrounds are concerned.

Let me rephrase my question… which behavior do you wish?

A. The content area background is only as tall as the contents.

B. The content area background is always at least as tall as the menu list.

C. In either A or B, the content area will extend if taller than the menu list. The green background is always properly matched left and right.

A: AC: B: BC:

Hi ronpat.

From your choices above, I am leaning towards C. Some of my pages will have more content (images of jewelry I have made in the past as examples of what I can do for custom orders). The order form on the special request page will be the “shortest” content area. Now how do I achieve that with the background images? Do I make a background image that includes both menu background and content background or are they going to be separate? Thanks for your help with this. BTW, the slider will only be on the home page.

:lol: I should NEVER write poll questionnaires :nono:

A, B, and C above are descriptions.

A and B are the choices and describe the way the bottom of the content area behaves when the content is shorter than the menu.

C simply shows that both A and B will extend longer than the menu if needed, and that the bottom of the green image beneath the content is matched to the green image beneath the menu using either method A or method B.

You can have it either way, A or B. With both, you get C. However the code and images for A and B are different, so that is why the question… the choice is between A and B.

Sorry I misunderstood. Then B is my choice.

Here’s my version of your objective (as I understand it). I started from scratch so the code is all new as are some of the images.

(1) *** To see how blocks are laid out, enable the “TEST Outlines” in CSS. ***

(2) The brown content background area is always as long as the main menu or longer; never shorter.

(3) You can change the number of items in the left column menu and the design will adapt.

(4) The 1px border appears at the top and right edges only.

(5) Probably reduced almost 300 KB of image size; but the total is still ~1500 KB. The .png menu sprites are ~650 KB.

(6) You will have to reposition the slider dots.

(7) This version has been tested with IE8+, Opera, FF & Chrome.

All files are in this folder:

https://www.dropbox.com/sh/g6ntwdqhi7wbb7l/JDgfMSU818

Please let me know after you have downloaded it, and especially if you find any problems.

(This can be run on your PC before loading anything on the server.)

Hope it is useful,
Cheers

Thank you so much, ronpat. This is incredible. My CSS skills have improved over the years of being on this site but still greatly lacking compared to yours. This is exactly what I was looking for. Thank you for adding the comments as well so I can see what is happening in each section and learn from my mistakes.

cgacfox, I have no idea whether or not there were “mistakes” in your code. I am simply not comfortable floating so many things left, so I chose a different strategy. The leftcolumn and rightcolumn are the only two objects that are floated… left floats left, right floats right. The logo is the only object that is positioned[absolute]. Everything else goes with the flow… even the slider.

If you need help tweaking any of the content dimensions, feel free to ask. (I don’t think I commented them very well.)

It was fun. Glad it works the way you want! :slight_smile:

Take care.

Good work Ron - looks much better now :slight_smile:

You could still optimise some of those images down. For example the menu item down the side only needs the one main background and then just add the different text images which could all be contained in one sprite. Then instead of having 10 images of 65k you would have one image of 32k (or a jpg of abut 11k with only a slight loss of quality) and then a sprite for the text and hover effect which would run in at under 30k. That would change that left menu from 650k down to about 30k - 60k in total. You would of course need the psd to grab the separate text images.

For the 260k slider image you could slice it into three which will give you 45k for the top and 45 for the bottom and then the middle could be a jpg of about 20k saving about 160k again. There may be a slight mismatch between jpg and png so it would be a matter of trying and seeing what it looks like.

The 2 above methods would reduce 1000k down to about 150k which is far more manageable on the web. Of course there may some compromise in quality but speed must be the first concern as users have been shown time and time again to click away from sites that don’t load quickly.

Thanks, Paul. I will look into doing as you suggested.

@Paul_O_B,

Thanks for examining my code. Your admonition about the size of the images inspired me to give them another look.

First, let me say that I intentionally did not try to modify the .pngs because Mr. fox had not responded to several suggestions to do so. The transparency in the menu sprites did not lend them to becoming .jpgs and likewise the transparency in the slider background… so I left them alone… didn’t explore other options.

Now to my revisit.

A new strategy…! The menu images have been reduced from 10 individual .pngs to 2, menupad.png and menusprites.png. The byte count went down from approx 650 KB to 102 KB (and of course the image count went down by 8). The advantage here is that the images remain .pngs and keep their transparency! This design is indistinguishable from the original. The new sprites are applied by adding a pair of span tags within each menu anchor.

The other image that I revisited is the slider_bg.png. 261 KB seemed excessive, but I couldn’t turn it into a .jpg without sacrificing its transparency. Today I made a screen capture with the slider turned off and saved it as a medium quality jpg, slider_bg.jpg. Because it is a screen capture, it retains the appearance of transparency and reduces the byte size to 35 KB. Only under magnification is the .jpg artifact noticable. The size reduction is very significant and was easy enough to accomplish.

The image related byte count is now ~343 KB + the slide show at ~377 KB = ~720 KB. Still hefty, but much better than the previous 1500 KB and SO much better than the full blown Wordpress’ bloat.

images: slider_bg.jpg, menupad.png, menusprites.png

@cgacfox,

To add slide_bg.jpg and save 226 KB, drop the new image into your images directory and change the suffix from .png to .jpg in your CSS (CSS shown below). Easy.

To replace the menu sprites, drop the 2 new images into your images directory and replace the all of the menu code:


/* -------------------------------------------- *\\
   Main Menu
\\* -------------------------------------------- */

.menu {
    list-style-type:none;
    padding:0;
    margin:0;
}
.menu li {
    width:161px;
    height:162px;
    margin-top:20px;
    margin-left:15px;
}
.menu li a {
    display:block;
    width:161px;
    height:162px;
    position:relative;
    background-image:url(../images/menupad.png);
    font:0/0 a;    /*use the next 3 lines instead of text-indent: -9999px*/
    text-shadow:none;
    color:transparent;
}
.menu li a span {
    position:absolute;
    top:71px;
    left:46px;
    width:106px;
    height:50px;
    background-image:url(../images/menusprites.png);
}
.menu li.home a span {
    background-position:0 0;
}
.menu li.home a:hover span {
    background-position:106px 0px;
}
.menu li.about a span {
    background-position:0 50px;
}
.menu li.about a:hover span {
    background-position:106px 50px;
}
.menu li.necklaces a span {
    background-position:0 100px;
}
.menu li.necklaces a:hover span {
    background-position:106px 100px;
}
.menu li.bracelets a span {
    background-position:0 150px;
}
.menu li.bracelets a:hover span {
    background-position:106px 150px;
}
.menu li.earrings a span {
    background-position:0 200px;
}
.menu li.earrings a:hover span {
    background-position:106px 200px;
}
.menu li.lanyards a span {
    background-position:0 250px;
}
.menu li.lanyards a:hover span {
    background-position:106px 250px;
}
.menu li.bookmarks a span {
    background-position:0 300px;
}
.menu li.bookmarks a:hover span {
    background-position:106px 300px;
}
.menu li.request a span {
    background-position:0 350px;
}
.menu li.request a:hover span {
    background-position:106px 350px;
}
.menu li.available a span {
    background-position:0 400px;
}
.menu li.available a:hover span {
    background-position:106px 400px;
}
.menu li.testimonials a span {
    background-position:0 450px;
}
.menu li.testimonials a:hover span {
    background-position:106px 450px;
}

/* -------------------------------------------- *\\
   flexslider
\\* -------------------------------------------- */

.flexslider {
/*    outline:1px solid white;    /* TEST Outline (compare outline to border) */
    height:420px;
    background:url(../images/slider_bg.jpg) no-repeat 50% 0;
    padding:0;
    margin:0 auto;
}

Add [noparse]<span></span>[/noparse] tags to the menu items:


                    <li class="home"><a href="index.html"><span></span>Home</a></li>
                    <li class="about"><a href="about.html"><span></span>About Me</a></li>
                    <li class="necklaces"><a href="necklaces.html"><span></span>Necklaces</a></li>
                    <li class="bracelets"><a href="bracelets.html"><span></span>Bracelets</a></li>
                    <li class="earrings"><a href="earrings.html"><span></span>Earrings</a></li>
                    <li class="lanyards"><a href="lanyards.html"><span></span>Lanyards</a></li>
                    <li class="bookmarks"><a href="bookmarks.html"><span></span>Bookmarks</a></li>
                    <li class="request"><a href="request.html"><span></span>By Special Request</a></li>
                    <li class="available"><a href="available.html"><span></span>Available Now</a></li>
                    <li class="testimonials"><a href="testimonials.html"><span></span>Testimonials</a></li>

The complete demo can be found here:
https://www.dropbox.com/sh/2prcojgkcp8rid0/qZ7e_MzmZ3

After testing successfully, delete the unused menu images. I suggest keeping the slider_bg.png. Should you reposition the slider on the page, you may need to make another .jpg and will need the .png to do so.

Tested in FF, Chrome, Opera, IE8, IE10

Cheers!

Thanks ronpat. That is actually Ms. Fox! :wink: I have accidently left off a page in the menu that needs to be added under lanyards. It will be eyeglass Chains. How easily can I add that menu item?