SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Grid Layout Lost

    Hi From medieval York UK :-)

    My battle to get a consistent home page griod layout continues :-( With thanks to suggestions from site point members i got rid of a FF bug which hid the homepage images. This was achived by removing this snippet of illustrated Javascript code:
    http://i216.photobucket.com/albums/c...ps8e48b47e.jpg

    But this has indroduced a minor problem Yes the images always display on the home page but a gate a broken picture layout as in:
    http://i216.photobucket.com/albums/c...ps29ca466f.jpg

    What i need is the layout to always appear grid line as in:
    http://i216.photobucket.com/albums/c...ps55abd5aa.jpg

    Please bare in mind I am tinkering with code I paid for (No I cant get back to the original designer) so my knowledge isnt brilliant :-(

    So is there a CSS solution to keep the pics in a grid structure on the home page rather than creating whitespace?

    Any insights welcome,
    Thanks,
    David
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  2. #2
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Hi,

    Wasn't the code you removed the fix I gave you to make the layout behave and as mentioned in the site that you got the script from?

    I'm sure I had that working fully locally with the fixes I gave.

    You'll have to give me a link to the page again and I'll look at it tomorrow

  3. #3
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by Paul O'B View Post
    Hi,

    Wasn't the code you removed the fix I gave you to make the layout behave and as mentioned in the site that you got the script from?

    I'm sure I had that working fully locally with the fixes I gave.

    You'll have to give me a link to the page again and I'll look at it tomorrow
    Hi paul...

    The page in question is www.davidclick.com . Yes whils that Javascript code did getthe grid layout consistent a FF bug got introduced in that dosplay:none was being added to the source code. :-(

    The situation now is no firefox bug but layout gappy with white space, oh dear...

    Thanks,
    David
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  4. #4
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    HI,

    If the page works with the scrpt in place and then occasionally you are getting a display:none added then how about trying to force the image to always be display:block.

    e.g. Original script.
    Code:
    <script>
    $(function() {    var $container 	= $('#am-container'),
            $imgs		= $container.find('img').hide(),
            totalImgs	= $imgs.length,
            cnt			= 0;
     
        $imgs.each(function(i) {
            var $img	= $(this);
            $('<img/>').load(function() {
                ++cnt;
                if( cnt === totalImgs ) {
                    $imgs.show();
                    $container.montage();
                }
            }).attr('src',$img.attr('src'));
        });	
     
    });
    
    </script>

    Extra CSS:
    Code:
    .galWrap img{display:block!important}
    I have no idea if this will make any difference but adding the script fixes the display issue immediately for me locally but I can't reproduce your whole site to test

    I'm sure the answer is in the script rather than css but try what I suggest and see what happens.

  5. #5
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks Paul,
    I"ll give this fix a whirl tomorrow :-)
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  6. #6
    SitePoint Guru Zygoma's Avatar
    Join Date
    May 2006
    Location
    York, Uk
    Posts
    916
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank You Paul your solution fixed a problem that was totally stressing me out. You generosity for taking time out to fix this is very much appreciated :-)
    I have had a perfectly wonderful
    evening, but this wasn't it-
    Julius "GROUCHO" Marx - 1890-1977
    http://www.davidclick.com

  7. #7
    The CSS Clinic is open silver trophybronze trophy
    Paul O'B's Avatar
    Join Date
    Jan 2003
    Location
    Hampshire UK
    Posts
    40,367
    Mentioned
    180 Post(s)
    Tagged
    6 Thread(s)
    Glad it worked I'll keep my fingers crossed.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •