Re: [jQuery] ANNOUNCE: Thickbox Reloaded alpha

2007-02-27 Thread Alex Calara
When using gallery images, the load when switching images is very  
intrusive. A less disruptive method would place the loading spinner  
on top of the current image until the next image is loaded (rather  
than making the current image disappear completely). The downside is  
IE's poor handling of transparent PNG.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] show() for table elements?

2007-02-06 Thread Alex Calara
Well, this isn't triggered by a span, but by a click on the table,  
maybe it'll help.

What I needed was to collapse certain rows and show a message to  
"Click to expand", but only if javascript was available to do the  
hide/unhide (as opposed to hiding it in my css and suddenly having  
people not be able to see it without javascript).

WARNING: I'm sure this is not the best way to do this, but it worked  
in a pinch. Where it falls apart is when you have tables with varying  
numbers of columns - I haven't figured out how to have it count the  
columns and set the appropriate colspan.

The table gets a class of .expandTable, and then any rows that need  
to be hidden get a class of .collapsed:


   always visible
   collapse if javascript is available



Then, hide all the rows that have a class of .collapsed:

$('.collapsed').hide();


Find the last row in the table, and tack on another row that contains  
the "click for more/less" row:

$('tr.collapsed:last-child').after('Click to  
see more / less');


Then toggle between showing and hiding the collapsed rows on any  
click on the table.

$('.stripeMe').click(
   function() {$(this).find('.collapsed').toggle(); // show/hide  
collapsed rows
   }
);




On Feb 6, 2007, at 4:27 AM, halfer wrote:

>
>
> howard chen wrote:
>>
>> show() only work good for DIV tags, but not table, e.g.
>>
>> --
>>
>> 
>> title...
>>
>> 
>> 
>>  22sksksis
>> 
>> 
>>  22sksksis
>> 
>> 
>>  22sksksis
>> 
>> 
>>
>> 
>>
>> hello
>>
>>
>
> Yes, this would be unlikely to work, though I've never tried it.  
> Extra code
> would need to be written that progressively expands the line height  
> of a row
> to an intended final height before moving onto the next one.  
> Perhaps writing
> it as a plugin would be a good approach?
> -- 
> View this message in context: http://www.nabble.com/show%28%29-for- 
> table-elements--tf3180071.html#a8824408
> Sent from the JQuery mailing list archive at Nabble.com.
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] Proposed selector patch: select by name

2007-02-02 Thread Alex Calara
I don't know if this is related, but the NAME attribute is deprecated  
in XHTML, being replaced by ID.


On Feb 2, 2007, at 1:34 PM, Austin Schutz wrote:

>   The name property is associated with every (or nearly every? are
> there exceptions?) DOM element. In my code I make extensive use of the
> name property, and it has been extremely useful to refer to  
> specific elements
> directly by their name property rather than id or class.
>   When used repeatedly, it is much cleaner (and I suspect faster,  
> though
> I haven't benchmarked it) than the equivalent '[EMAIL PROTECTED]' selector.
>
>   I would submit this as a plugin, but I don't believe this fundamental
> of a change is possible via a plugin.
>
>   I've used the '%' character for lack of something more appropriate,
> though this is somewhat arbitrary.
>
>> diff jquery-latest.js jquery-local.js
> 742a743
>>   "%": "a.getAttribute('name')==m[2]",
> 817c818
> <   /^([:.#]*)([a-z0-9_*-]*)/i
> ---
>>   /^([:.#%]*)([a-z0-9_*-]*)/i
> 1035c1036
> <   while ( t && /^[a-z[({<*:.#]/i.test(t) ) {
> ---
>>   while ( t && /^[a-z[({<*:.#%]/i.test(t) ) {
>
>   I plan on presenting a particular coding pattern which uses this
> in a separate email, but I wanted to propose this on its own merits  
> separately
> so as to avoid the further debate regarding coding style.
>
>   Comments?
>
>   Thanks,
>
>   Austin
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] position clearing ala Shaun Inman

2007-01-31 Thread Alex Calara
I'm sure my designer won't really like the fact that it looks weird  
during resize. If he doesn't, is there a solution for that as well?

On Jan 31, 2007, at 1:10 PM, Jörn Zaefferer wrote:

> Alex Calara schrieb:
>> Ah, that does it. It's a little laggy, you can resize the window all
>> day long with the columns adjusting and the footer stays exactly
>> where it started off, and then the moment you let go of the mouse
>> button, it snaps to the bottom of the longest column. I guess the
>> jQuery resize event only triggers once the window is officially
>> considered "RESIZED." This also explains the timer (is that 50ms?) on
>> Inman's original script, constantly remeasuring.
>>
> Afaik Fireforx triggers the event after the resize has finished, while
> IE triggers it already while still resizing.
>
> But I'd consider that a non-issue, or would someone blame you because
> the layout is weird *while* resizing?
>
> The only tweak I can imagine would be to add a sort plugin and using
> that instead of get().sort()...
>
> -- 
> Jörn Zaefferer
>
> http://bassistance.de
>
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] position clearing ala Shaun Inman

2007-01-31 Thread Alex Calara
Ah, that does it. It's a little laggy, you can resize the window all  
day long with the columns adjusting and the footer stays exactly  
where it started off, and then the moment you let go of the mouse  
button, it snaps to the bottom of the longest column. I guess the  
jQuery resize event only triggers once the window is officially  
considered "RESIZED." This also explains the timer (is that 50ms?) on  
Inman's original script, constantly remeasuring.

I love being able to do this without having to tack extra classes on  
to my columns or jamming on a script tag at the bottom of the page.  
I'm already loading jQuery for other functions, and it seemed  
senseless to tack on another 3k.

Thanks so much guys - let me know if you have any other tweaks to this.

- Alex Calara

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] position clearing ala Shaun Inman

2007-01-30 Thread Alex Calara
Much closer!

I assumed that just getting all the divs in my #content div would  
still yield an array, so I ended up with this:

var columns = $('#content div').get().sort(function(a, b) {return $ 
(b).height() - $(a).height();});
var highest = columns[0];
$(highest).css({position: "relative"});

If all columns are fixed width or all percentages it works fine. So,  
now all that's missing is executing this again on resize. Take the  
following scenario:

Three columns, a narrow column with a fixed width, and a wider column  
with a percentage width. If the sidebar starts off as the tallest, it  
is set to relative, and the footer stays below it. But as the window  
gets narrower, so does the main column, and at one point, it becomes  
taller than the sidebar. Without triggering again on resize, then the  
sidebar is still the relative column.

I just had a thought - my method of setting the position:relative  
directly with jQuery isn't very conducive to removing that attribute  
once we do get it to trigger on resize. toggleClass won't quite do  
what I'm after, will it?





On Jan 30, 2007, at 3:56 AM, Klaus Hartl wrote:

> var columns = $('#column-1, #column-2,
> #column-3').get().sort(function(a, b) {
>  return $(b).height() - $(a).height();
> });
> var highest = columns[0];


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] position clearing ala Shaun Inman

2007-01-29 Thread Alex Calara



On Jan 29, 2007, at 5:56 AM, Rob O'Rourke wrote:
> It might be worth re-visiting Shaun's article...
> The crux of Shaun Inman's clearing script is that it changes the CSS
> rule for the longest column in an absolutely positioned layout to
> 'position: relative;'. He does this simply by comparing the heights of
> his main columns and setting the css rule 'position: relative;' (as
> opposed to default absolute) on the longest one by switching its
> class-name. This brings it back into normal document flow so the  
> footer
> that has no positioning defined (absolute or relative) will be pushed
> down in the normal way.
>
> You would be much better off keeping this approach intact instead of
> messing around with ems and trying to actually position the footer  
> with
> javascript directly. You'll be tearing your hair out getting that to
> work cross-browser.

That sounds reasonable. So I would have to just pull the height out  
with jQuery (not needing the dimensions plugin, since I no longer  
need the offsets)? I am still unsure of how to compare the heights  
once I do get them. I also don't know how to run this both on load  
and on resize (either browser or text). I think I can figure out the  
necessary css manip with jQuery, as I've done that before.

Maybe I should just go off and learn javascript, but unlike jQuery,  
that is not *fun*. I just hate seeing code that A: doesn't make sense  
to me, and B: seems like it could be done sensibly without sticking  
yet another script at the bottom of the page.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] position clearing ala Shaun Inman

2007-01-28 Thread Alex Calara
The CSS I can handle. It's the writing of the jQuery function I need  
that I can't do. For convenience's sake, I'll paste my message again.




Here's what I *want* to do: I want to have jQuery reposition a footer  
below a div which has no height (because all its children are  
absolutely positioned). This needs to happen both on window load and  
resize (possibly even with unhiding content?), in order to keep the  
footer at the bottom of any columns which change in size.

Considering that the dimensions plugin doesn't seem to have any  
facility to tell me where the bottom of an element is, I think that I  
need to: grab the height and top offset from the children of  
#content; add the top offset and height of each child together;  
determine which child has the greatest total height; and finally set  
the top of the footer to the result.

I am just not sure how to go about this. I've managed to get the  
height of any one container, and set the top of the footer to that,  
but of course, it's not down far enough, as I don't have the top  
offset and such. I can't figure out how to get only the top offset  
from the dimensions plugin - it hands me an array, and I can't seem  
to cull just the second element out of it.






On Jan 28, 2007, at 11:32 AM, Olaf Bosch wrote:

> Alex Calara schrieb:
>>> On Jan 28, 2007, at 2:43 AM, Olaf Bosch wrote:
>>> Try, look at the demension-plugin, let them read the height of the
>>> colums.
>>> The longest use to set the footer.
>>>
>>> Set this variable in the Script to the footer:
>>> top: LONGEST-COLUMN-HEIGHTpx;
>>>
>>>
>>> in your CSS
>>> #footer{
>>> position:absolute;
>>> left: /* what you will */;
>>> width: /* what ever */;
>>> 
>>> }
>>
>>
>> I don't think you read the explanation of my problem, and instead you
>> read my reply to Jake (which was explaining why his solution wouldn't
>> work for me). Look up a couple posts, and you'll see my full
>> explanation.
>
> Sorry i see this Problem, you become not the footer at the bottom
>
> The Window, all 3 DIV are absolute:
> ___
> | DIV1 | DIV2 | DIV3 |
> | | | |
> |_| |_|
>|_|--- Window cane here end
> ___
> | #footer  | --- or here or other pos.
> |__|
>
> I hope is visual to see :/
>
> Then you must give the Footer what i written.
>
> Sorry when i posted shit, bad english understanding.
>
> Otherwise, cane you post a link to a demo of the Problem?
>
>
> -- 
> Viele Grüße, Olaf
>
> ---
> [EMAIL PROTECTED]
> http://olaf-bosch.de
> www.akitafreund.de
> ---
>
> ___
> jQuery mailing list
> discuss@jquery.com
> http://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] position clearing ala Shaun Inman

2007-01-28 Thread Alex Calara
> On Jan 28, 2007, at 2:43 AM, Olaf Bosch wrote:
> Try, look at the demension-plugin, let them read the height of the  
> colums.
> The longest use to set the footer.
>
> Set this variable in the Script to the footer:
> top: LONGEST-COLUMN-HEIGHTpx;
>
>
> in your CSS
> #footer{
> position:absolute;
> left: /* what you will */;
> width: /* what ever */;
> 
> }


I don't think you read the explanation of my problem, and instead you  
read my reply to Jake (which was explaining why his solution wouldn't  
work for me). Look up a couple posts, and you'll see my full  
explanation.

___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] position clearing ala Shaun Inman

2007-01-27 Thread Alex Calara
Ah, here's the problem with that: it attaches a footer to the bottom  
of the window, rather than to the bottom of the content. What I'm  
looking for is repositioning an existing footer at the bottom of the  
longest column in my #content section. There's three columns, and  
each is positioned absolutely, so that their parent element  
collapses. This is where my main problem comes in. I'm trying to see  
if there's a non-floated layout where I can have the footer in the  
correct place, just beneath the content.


On Jan 27, 2007, at 6:32 PM, Ⓙⓐⓚⓔ wrote:

> You say footers? I've done footer! the code is mainly css with the
> contents for the footer generated by jquery.
>   $("body").metaFootie();
> where
> jQuery.fn.metaFootie = function() {
>   var a = []
>   $("[EMAIL PROTECTED]").each(function(){a[a.length] = "" + this.name + ""});
>   return this.append("Meta:" + a.join(' – ') +
> "").children('.meta').click(function(){$(this).hide('slow')})
> }
>
> and the css in question is
> .meta
> {
>   color: blue;
>   background-color: yellow;
>   border: 1px solid #00;
>   position: fixed;
>   left: 0px;
>   top: auto;
>   bottom: 0px;
>   display: block;
>   font-size: large;
>   font-style: italic;
>   z-index: 1000;
>   width: 100%;
>
> }
>
>
> hope it helps... the guts of the positioning  was all in the css!
>
> On 1/27/07, deadguy <[EMAIL PROTECTED]> wrote:
>>
>> Ok, I guess I need to rephrase my question now that part of the  
>> original has
>> been answered:
>>
>> I don't know enough javascript to understand exactly what Shaun's  
>> code is
>> doing, nor do I have enough jQuery experience to rewrite it in  
>> jQuery.
>>
>> Here's what I *want* to do: I want to have jQuery reposition a  
>> footer below
>> a div which has no height (because all its children are absolutely
>> positioned). This needs to happen both on window load and resize  
>> (possibly
>> even with unhiding content?), in order to keep the footer at the  
>> bottom of
>> any columns which change in size.
>>
>> Considering that the dimensions plugin doesn't seem to have any  
>> facility to
>> tell me where the bottom of an element is, I think that I need to:  
>> grab the
>> height and top offset from the children of #content; add the top  
>> offset and
>> height of each child together; determine which child has the  
>> greatest total
>> height; and finally set the top of the footer to the result.
>>
>> I am just not sure how to go about this. I've managed to get the  
>> height of
>> any one container, and set the top of the footer to that, but of  
>> course,
>> it's not down far enough, as I don't have the top offset and such.  
>> I can't
>> figure out how to get only the top offset from the dimensions  
>> plugin - it
>> hands me an array, and I can't seem to cull just the second  
>> element out of
>> it.
>>
>> I know this seems like a silly endeavor, but it seems ridiculous  
>> to tack
>> Shaun's code on the end of my HTML when jQuery has such a nice  
>> mechanism for
>> firing it off. Also, I've enjoyed noodling around with jQuery, and  
>> I've
>> gotten a number of things to work that I'm sure I would have taken  
>> me weeks
>> to figure out with pure JS.
>>
>>
>>
>>
>> bmsterling wrote:
>>>
>>> I would assume you can do this quite easily with the dimensions  
>>> plugin,
>>> find
>>> the tallest elements and set the position of the footer to  
>>> match.  To
>>> answer
>>> your question, if done in jquery I believe it would be smaller  
>>> and faster.
>>>
>>> -Original Message-
>>> From: [EMAIL PROTECTED] [mailto:discuss- 
>>> [EMAIL PROTECTED] On
>>> Behalf Of deadguy
>>> Sent: Thursday, January 18, 2007 12:35 PM
>>> To: discuss@jquery.com
>>> Subject: [jQuery] position clearing ala Shaun Inman
>>>
>>>
>>> I've been reading through Transcending CSS by Andy Clarke, and he  
>>> mentions
>>> using Shaun Inman's clearance method
>>> (http://shauninman.com/post/heap/2006/05/22/ 
>>> clearance_position_inline_absolu
>>> te)
>>> to position footers when using absolute positioning for layout.
>>>
>>> Since I'm already using jQuery for a number of other things (they  
>>> are all
>>> quite simple - I'm still a novice at JS), I was wondering if a  
>>> jQuery
>>> version of his script would be smaller/faster or if I ought to  
>>> just use
>>> his
>>> script in addition to the jQuery I'm already using.
>>>
>>> Thanks
>>> --
>>> View this message in context:
>>> http://www.nabble.com/position-clearing-ala-Shaun-Inman- 
>>> tf3035522.html#a8435
>>> 293
>>> Sent from the JQuery mailing list archive at Nabble.com.
>>>
>>>
>>> ___
>>> jQuery mailing list
>>> discuss@jquery.com
>>> http://jquery.com/discuss/
>>>
>>>
>>> ___
>>> jQuery mailing list
>>> discuss@jquery.com
>>> http://jquery.com/discuss/
>>>
>>>
>>
>> --
>> View this message in cont