Article View: pl.comp.lang.javascript
Article #50323Re: Chrome ucina content przy skrypcie equal jQuery
From: emil
Date: Wed, 06 Oct 2010 20:39
Date: Wed, 06 Oct 2010 20:39
62 lines
2452 bytes
2452 bytes
On 10/06/2010 08:08 PM, hazet wrote:
> hazet pisze:
>> Witam,
>>
>> oto skrypt wykorzystujący jquery:
>>
>> function equalHeight(group) {
>> tallest = 0;
>> group.each(function() {
>> thisHeight = $(this).height();
>> if(thisHeight > tallest) {
>> tallest = thisHeight;
>> }
>> });
>> group.height(tallest);
>> }
>> $(document).ready(function() {
>> equalHeight($("#content, #sidebar"));
>> });
>>
>>
>> Wszystko jest ok w ff, ie a googe chrome ucina paginacje (ostatni blok
>> w content) tak jakby jej nie było. Clear nic nie daje.
>
>
> oto css paginacji:
>
> #pagination {
> width: 310px;
> margin: 30px auto;
> overflow: hidden;
> height: 100%;
> }
>
> #pagination a {
> float: left;
> padding: 5px 10px;
> border: 1px solid #ccc;
> margin-right: 5px;
> text-decoration: none;
> background: #fff url('images/pagin_bg.png') repeat-x bottom;
> font: 12px arial, sans-serif;
> }
>
> #pagination a:hover, #pagination .active_page {
> background: #ff3f19 url('images/pagin_hover.png') repeat-x bottom;
> color: #fff;
> }
>
>
>
> Ewidentnie w podglądzie ff i chrome widze, że różni się dodany height w
> stylu inline. W ff jest 792px a w chromiaku 692px.
> Z jakiegoś powodu nie widzi ostatniego bloku, nie wiem czemu.
1. Na początek dodaj sobie var do deklaracji zmiennych.
2. Sprawdź w debuggerze co powinno być zwrócone (tzn. ile ma #content, a
ile #sidebar bez wywoływania equal height).
3. Na divie, w który masz floaty zrób clearfix (wygooglaj).
itp. aż nie dojdziesz do celu.
pzdr.
emil
Technical Details
Message-ID:
<i8impr$i9l$1@news.onet.pl>Path:
mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mailReferences:
<i8id8p$c1$1@inews.gazeta.pl> <i8idvi$36q$1@inews.gazeta.pl>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!news-archive.icm.edu.pl!news.rmf.pl!agh.edu.pl!news.agh.edu.pl!news.onet.pl!not-for-mail From: emil <emjot@poczta.onet.pl> Newsgroups: pl.comp.lang.javascript Subject: Re: Chrome ucina content przy skrypcie equal jQuery Date: Wed, 06 Oct 2010 22:39:18 +0200 Organization: http://onet.pl Lines: 62 Message-ID: <i8impr$i9l$1@news.onet.pl> References: <i8id8p$c1$1@inews.gazeta.pl> <i8idvi$36q$1@inews.gazeta.pl> NNTP-Posting-Host: sj036.multi-play.net.pl Mime-Version: 1.0 X-Trace: news.onet.pl 1286397563 18741 91.142.194.154 (6 Oct 2010 20:39:23 GMT) X-Complaints-To: niusy@onet.pl NNTP-Posting-Date: Wed, 6 Oct 2010 20:39:23 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.12) Gecko/20100915 Thunderbird/3.0.8 In-Reply-To: <i8idvi$36q$1@inews.gazeta.pl> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit