2010-06-04 37 views
0

雖然firefox管理,即和鉻拒絕崩潰的div比圖片的高度更遠。此外(但很小),即(正確地?)將文本包裝在圖片周圍,而由於某些原因,我無法弄清楚Firefox的文本看起來是正確的。MooTools手風琴不會崩潰嵌套漂浮在鉻&即

感謝您的幫助!

的JavaScript:

window.addEvent('domready', function(){ 


$$('.bio_accordion').each(function(item){ 

    var thisSlider = new Fx.Slide(item.getElement('.moreInfo'), { mode: 'horizontal' }); 
    thisSlider.hide(); 


item.getElement('.moreInfo').set('tween').tween('height', '0px'); 

    var morph = new Fx.Morph(item.getElement('.divToggle')); 
    var selected = 0; 
    item.getElement('.divToggle').addEvents({ 
    'mouseenter': function(){ 
    if(!selected) this.morph('.div_highlight'); 
    }, 

    'mouseleave': function(){ 
    if(!selected) { 
    this.morph('.divToggle'); 
    } 
    }, 

    'click': function(){ 
    if (!selected){ 
    if (this.getElement('.symbol').innerHTML == '+') 
    this.getElement('.symbol').innerHTML = '-'; 
    else 
    this.getElement('.symbol').innerHTML = '+'; 
    thisSlider.slideIn(); 
    item.getElement('.moreInfo').set('tween', { 
    duration: 1500, 
    transition: Fx.Transitions.Bounce.easeOut 
    }).tween('height', '650px'); 
    selected = 1; 
    } 
    else{ 
    if (this.getElement('.symbol').innerHTML == '+') 
    this.getElement('.symbol').innerHTML = '-'; 
    else 
    this.getElement('.symbol').innerHTML = '+'; 
    thisSlider.slideOut(); 
    item.getElement('.moreInfo').set('tween', { 
    duration: 1500, 
    transition: Fx.Transitions.Bounce.easeOut 
    }).tween('height', '0px'); 
    selected = 0; 
    } 
    } 
    }); 

}); 




}); 

的HTML:

<div class="bio_accordion"> 

<div class="divToggle">Lorem Ipsum<span class="symbol">-</span></div> 
<div class="moreInfo" style="margin-left:10px;"> 

<div class="photo"><img src="http://loremipsum.com/images/3.jpg" /></div>Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum. 
</div> 

的CSS:

.bio_accordion 
{ 
padding:0px; 
margin:0px; 
} 

.divToggle 
{ 
cursor: pointer; 
color: #ffffff; 
background-color:#1089b5; 
padding: 8px; 
} 

.div_highlight 
{ 
padding-left:30px; 
padding-right:30px; 
background-color:#096687; 
} 

.moreInfo 
{ 
padding: 2px; 
} 

.symbol 
{ 
float:right; 
} 

.photo 
{ 
float:left; 
padding-right:10px; 
height:inherit; 
} 

回答

1

變化

.moreInfo 
{ 
padding: 2px; 
} 

.moreInfo 
{ 
    padding: 2px; 
    overflow: hidden; 
} 
+0

謝謝!不知道我是如何忽略它的。 – nona 2010-06-05 19:33:43