| 
	
 | 
 Posted by dorayme on 04/07/07 01:47 
In article <1c82a$4616ec54$40cba7b3$30934@NAXS.COM>, 
 "Jonathan N. Little" <lws4art@centralva.net> wrote: 
 
> Jonathan N. Little wrote: 
> > dorayme wrote: 
> >  
> >> Nah, no good I am afraid. Yes, it is trying, but the effect is so  
> >> marginal as to count for a fail on this particular size thumbnail. (I  
 
> Okay in IE the clientWidth is the BODY - the scrollBar wide so the value  
>    to calculate from is now constant  with other browsers! So revised  
> function 
>  
> function centerMe(){ 
>    var clientWidth=document.documentElement.clientWidth; 
 
>  
> Great! But guess what? Even though there is room IE always puts 1 less  
> thumb across! Bugger! IE does not do floats... 
>  
> Now if you do browser sniffing and insure you got IE and not Opera  
> (which can to this all correctly I must add) you could add 1/2 the thumb  
> width allotment to balance the margin... 
>  
> function centerMe(){ 
>    var clientWidth=document.documentElement.clientWidth; 
.... 
>    //Use so sort of browser sniffer to IS a IE only! 
>    if( IsIE ) left+=(thumb/2);	//add 1/2 thumb for IE only 
>  
>    //grab the wrapper DIV 
>    var wrap=document.getElementById('wrapper'); 
>    //style it 
>    wrap.style.width=width + "px"; 
>    wrap.style.marginLeft=left + "px"; 
> } 
 
Both these new functions now ruin the effect entirely in Safari!  
Your first stab, 2 posts back, was good for many non IE.  
 
It is a reasonable thing to want, to be able to wrap thumbnails  
and to centre the mass of them with or without big left and right  
margin. Pity it is so hard! 
 
--  
dorayme
 
  
Navigation:
[Reply to this message] 
 |