#1 (permalink)  
Old 01-04-2012, 11:42 AM
scootermcq's Avatar
Ad lucem
 
Join Date: Jan 2010
Location: Ontario, Canada
Posts: 2,532
Default I need a Guru's Help

I figured out that the Jquery code I was trying to use would report too many errors if the user had a slower connection, older IE or my server was slow. Obviously I don't want that, so started over. I have found code for a different (but similar) gallery, but I have run into problems.

Landscape orientation images center properly, but portrait does not and is off set to the left.

Anyone have any tips for a blundering fool?

Code as it pertains to this part of the page:

CSS for page:

#contentc
{
margin-top: 10px;
margin-bottom: 0;
margin-left: auto ;
margin-right: auto;
width: 800px;
padding: 0px;
background-color: #FFF;
color: #000;
text-align: center;
}

CSS for Gallery:

.photoslider {
}
.photoslider_nav {
position: relative;
border: white 1px;
overflow: hidden;
height: 90px;
width: 800px;
margin: auto;
}
.photoslider_thumbBar {
position: absolute;
left: 0px;
top: 0px;
display: block;
margin: 0px;
padding: 0px;
}
.photoslider_thumb {
position: relative;
border: #6D7B8D 1px;
width: 50px;
height: 50px;
float: left;
padding: 5px;
margin: 5px;
cursor: pointer;
}
.photoslider_clear {
clear: both;
}
.photoslider_main {
position: relative;
height: 600px;
padding-bottom: 5px;
}
.photoslider_main img {
position: relative;
border: solid #6D7B8D 2px; display: block; margin: auto;
}
.photoslider_caption {
font-weight: bold;
text-align: center;
}
.photoslider_control {
display: none;
text-align: center;
font-weight: bold;
padding-top: 10px;
margin: auto;
height: 30px;
width: 52px;
}
.photoslider_play, .photoslider_stop {
width: 18px;
height: 19px;
margin: auto;
padding: 3px;
cursor: pointer;
text-align: center;
border: solid #fff 1px;
float: left;
}
.photoslider_play {
background: url('/images/play_pause.gif') no-repeat 0px 0px;
}
.photoslider_stop {
background: url('/images/play_pause.gif') no-repeat -25px 0px;
}
.slideshow_disabled {
border-bottom: solid #919191 2px;
}

HTML:

*



******** type="text/**********">
$(document).ready(function(){

FOTO.Slider.baseURL = 'index_htm_files/';
FOTO.Slider.bucket = {
'default': {
0: {'thumb': 'wt1.jpg', 'main': 'w1.jpg'},
1: {'thumb': 'wt2.jpg', 'main': 'w2.jpg'},
2: {'thumb': 'wt3.jpg', 'main': 'w3.jpg'},
3: {'thumb': 'wt4.jpg', 'main': 'w4.jpg'},
Etc. Etc.
}
};


FOTO.Slider.reload('default');
FOTO.Slider.preloadImages('default');
});
***********


Any help would sure be appreciated!
__________________
Scott

Last edited by scootermcq; 01-04-2012 at 11:45 AM.
Reply With Quote
  #2 (permalink)  
Old 01-04-2012, 12:36 PM
OsmosisStudios's Avatar
Don't Panic
 
Join Date: Sep 2008
Location: Mississauga / Ottawa
Posts: 11,357
Default

Here's the code im using for centering stuff with CSS.

#Container {
position:absolute;
left: 50%;
width: 1000px;
margin-left: -500px; /*set to a negative number 1/2 of your width*/
}

This is used as a div to contain the entire site, basically. So, you're pushing the div 50% of the width of the page, then backspacing it back half the pixel width of the div. It ends up centering things nicely.
__________________
I am responsible for what I say; not what you understand.
OsmosisStudios
Gear List
Reply With Quote
  #3 (permalink)  
Old 01-04-2012, 01:10 PM
Rentham's Avatar
Everything is permissible
 
Join Date: Feb 2011
Location: Cleveland, Ohio
Posts: 838
Default

Quote:
Originally Posted by OsmosisStudios View Post
This is used as a div to contain the entire site, basically. So, you're pushing the div 50% of the width of the page, then backspacing it back half the pixel width of the div. It ends up centering things nicely.
Margin: Auto; does the same thing when the element has a specified width.
__________________
Mike Evers
Rentham Creative | Twitter | Facebook
Reply With Quote
  #4 (permalink)  
Old 01-04-2012, 01:16 PM
scootermcq's Avatar
Ad lucem
 
Join Date: Jan 2010
Location: Ontario, Canada
Posts: 2,532
Default

Quote:
Originally Posted by OsmosisStudios View Post
Here's the code im using for centering stuff with CSS.

#Container {
position:absolute;
left: 50%;
width: 1000px;
margin-left: -500px; /*set to a negative number 1/2 of your width*/
}

This is used as a div to contain the entire site, basically. So, you're pushing the div 50% of the width of the page, then backspacing it back half the pixel width of the div. It ends up centering things nicely.
Thanks Adam... I will give it a shot this evening and see if that works
__________________
Scott
Reply With Quote
  #5 (permalink)  
Old 01-04-2012, 02:17 PM
OsmosisStudios's Avatar
Don't Panic
 
Join Date: Sep 2008
Location: Mississauga / Ottawa
Posts: 11,357
Default

The other thing you could do, which is likely easier and doesnt really increase size that much, is just make your vertical shots the right size with extra blank canvas space. Only really works if you're working with a flat-colour background.
__________________
I am responsible for what I say; not what you understand.
OsmosisStudios
Gear List
Reply With Quote
  #6 (permalink)  
Old 01-04-2012, 02:35 PM
SwissJon's Avatar
Enjoys shooting people.
 
Join Date: Oct 2010
Location: Switzerland
Posts: 4,512
Default

Download Firebug for Firefox. Start it then load your page. Now click on the HTML tab, abd on the right hand side, choose "Layout"

You'll then be able to click on any code elements and see how each of them effect your code visually.

I suggest you also use separate CSS for older versions of IE, and then import the code that breaks it for the newer versions. Here's a page discussing how to do that.

CSS Guides: Separate style sheet for old browsers, SSI-Developer.net
__________________
A photo needs to start and finish in your imagination, if it passes through your camera in between, that's cool, if it doesn't, that's cool also.
Flickriver Portfolio 500px Flickr NSFW
Reply With Quote
  #7 (permalink)  
Old 01-04-2012, 03:02 PM
Biomech's Avatar
World Commended
 
Join Date: May 2009
Location: UK
Posts: 2,234
Default

I use margin: auto like Rentham :P
__________________
Art: www.jamieorourke.co.uk
Work: www.jamieorourkephotography.co.uk
Work: Photo booth Hire in the West Midlands, and Wales
Sony a200 Sony a580, Canon 500D, Photobooth
Reply With Quote
  #8 (permalink)  
Old 01-04-2012, 03:15 PM
OsmosisStudios's Avatar
Don't Panic
 
Join Date: Sep 2008
Location: Mississauga / Ottawa
Posts: 11,357
Default

Quote:
Originally Posted by Rentham View Post
Margin: Auto; does the same thing when the element has a specified width.
Not from experience. It's hit or miss on certain things, especially when you've got, as I do, divs within divs. Margin: Auto; tends to apply in subdivs, which isnt what I wanted. The code I showed is actually the "Container" that holds the entire site centered.

Margin: Auto; may work better for individual divs, though.
__________________
I am responsible for what I say; not what you understand.
OsmosisStudios
Gear List
Reply With Quote
  #9 (permalink)  
Old 01-04-2012, 04:43 PM
Rentham's Avatar
Everything is permissible
 
Join Date: Feb 2011
Location: Cleveland, Ohio
Posts: 838
Default

Quote:
Originally Posted by OsmosisStudios View Post
Not from experience. It's hit or miss on certain things, especially when you've got, as I do, divs within divs. Margin: Auto; tends to apply in subdivs, which isnt what I wanted. The code I showed is actually the "Container" that holds the entire site centered.

Margin: Auto; may work better for individual divs, though.
It's possible you have some coding errors or specificity problems in your CSS. I've found margin: auto to be very reliable. Check out the source on this simple test.
__________________
Mike Evers
Rentham Creative | Twitter | Facebook
Reply With Quote
Reply

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off



Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.

What’s Your Preference?

Daily Digest

Each day we send out a quick email to thousands of DPS readers to notify them of updates. This email is just short excerpt of the first few lines of our latest post with a link if you want to read it all. You can unsubscribe from this this service at any time.

This service is provided by a third party (Feedburner) and you can subscribe to it by leaving your email address in the following field and confirming your subscription when you get an email asking you to do so.

Enter your email address for
Daily Updates:

Weekly Summary

For those wanting a weekly summary of what happens on this site this free email newsletter is probably your best option. It includes a summary of the tips posted to the site each week. This newsletter is subscribed to by over 25000 readers (many who also subscribe to the other options above) - come join the community!

To subscribe to this weekly newsletter simply add your email address to the following field and then follow the confirmation prompts. You will be able to unsubscribe at any time.

Enter your email address for
Free Weekly Newsletter:

 
SEO by vBSEO 3.3.0