Re: [jQuery] Anyone ever heard of this Netscape bowser? ;)

2007-03-20 Thread Danny Wachsstock
Actually, I am calling it all from the parent. You can see it at youngisrael-stl.org ; look at the wood-grain calendar (in Hebrew) on the right. You don't have to be able to read it, but on a slow computer you can see it come up with scroll bars then re-adjust the size. '.load()' doesn't fire in I

Re: [jQuery] Anyone ever heard of this Netscape bowser? ;)

2007-03-19 Thread Danny Wachsstock
---But-need-help%3A-%22Object-doesn%27t-support-this-property-or-method%22-tf3413795.html";>see > here ). Same result though, can't get it to work in IE and I get the same > error: "Object doesn't support this property or method". > &g

Re: [jQuery] How can I find out if a

2007-03-19 Thread Danny Wachsstock
We had a very similar discussion on a thread last week: http://www.nabble.com/How-to-convert-%22class%22-to-%22style%3D%27attrs-...%27%22-tf3409582.html The code you want would be similar to: function isStyled(className){ var re = new RegExp('(^|,)\\s*\\.'+className+'\\s*(\\,|$)'); var ret =

Re: [jQuery] Anyone ever heard of this Netscape bowser? ;)

2007-03-19 Thread Danny Wachsstock
What I've had to do is: $('iframe.autoheight') .each(function(){this.style.height=(this.contentWindow.document.body.scrollHeight+40)+'px';}) .load(function(){this.style.height=(this.contentWindow.document.body.scrollHeight+40)+'px';}); in my $(function()... code It seems that IE loads the if

Re: [jQuery] How to convert "class" to "style='attrs ...'"

2007-03-16 Thread Danny Wachsstock
Oops...too tired when I wrote that. Make it if ((new RegExp('[^ ,]'+selector+'[$ ,]').test(this.selectorText))) but I haven't tested that either Danny Wachsstock wrote: > > Brilliant minds think alike :) The RegExp allows for stylesheets that use > a comma,

Re: [jQuery] How to convert "class" to "style='attrs ...'"

2007-03-15 Thread Danny Wachsstock
thumblewend wrote: > > On 16/03/2007, at 10:01 AM, Danny Wachsstock wrote: >> function styleString(selector){ >> var style = ""; >> $.each (document.styleSheets, function(){ >> $.each (this.cssRules || this.rules, function(

Re: [jQuery] How to convert "class" to "style='attrs ...'" [Offtopic]

2007-03-15 Thread Danny Wachsstock
My version (more jQuery-ish). It uses a very simple test for the selector (this.selectorText == selector) but you could use a fancier RegExp-based version if you wanted. It works in FF and IE. It does not deal with differing media and @import rules. function styleString(selector){ var style = "

Re: [jQuery] Auto Vertical Scroller newsBlock div

2007-03-06 Thread Danny Wachsstock
I made a news scroller a while back; you can see it at http://youngisrael-stl.org/updates.php at the upper right. It smoothly scrolls any element (I use H3 and LI, but you can specify), stops on mouseover and adds buttons to scroll back up or further down, and a button to expand the whole list. It

Re: [jQuery] Q: best way to create dynamic content?

2007-02-27 Thread Danny Wachsstock
Using innerHTML (like $('') is faster than DOM creation methods; see http://www.quirksmode.org/dom/innerhtml.html but for complicated trees it's harder to understand and debug. nrwsteff wrote: > > short question: > > what is the recommanded/better/fastest (memory footprint/execution time) > jQ

Re: [jQuery] Creating stylesheets in jQuery

2007-02-27 Thread Danny Wachsstock
toUpperCase();}); return elem.style[prop] || elem.style.getPropertyValue && elem.style.getPropertyValue(prop) || $(elem.selectorText).css(prop); }else{ return $._curCSS(elem, prop, force) } }; $._css = $.css; $.css = function (e,p){ if (e.selectorText) return $.curC

Re: [jQuery] problem with "edit in place" on HTML coding.

2007-02-27 Thread Danny Wachsstock
TML, things may not work. The reverse would beL function html_entity_encode(string) {return $('').text(string).html()} Hope this helps Danny Wachsstock Mark-235 wrote: > > no that`s not the best way.. can`t i assign a php function to javascript > and > use it th

Re: [jQuery] Creating stylesheets in jQuery

2007-02-27 Thread Danny Wachsstock
That works for Firefox, which treats the cssText as a textNode but fails in Internet Explorer. Yansky wrote: > > You could also do $("style").html("p{color:green;}"); if you wanted a > non-inline style rule applied to the page. > > > Danny Wachsstoc

[jQuery] Creating stylesheets in jQuery

2007-02-26 Thread Danny Wachsstock
This may be helpful to someone: I made a jQuery extension that lets you change the stylesheet styles, rather than the inline styles (which is what jQuery generally does). So you can do: $.style('p').css('color','green'); creates a stylesheet with a rule that sets the color of P elements, includi

Re: [jQuery] Creating an empty jQuery object

2007-02-18 Thread Danny Wachsstock
This may be hijacking the thread, so I'll keep it brief. i agree that innerHTML is useful, and it is a de-facto standard (like AJAX). I also agree that whatwg's work is much closer to reality than w3g's, and like I said, I'm not a fanatic standardista. My point is that it's harder to debug complic

Re: [jQuery] adding a class to positive and negative data cells in a table column

2007-02-17 Thread Danny Wachsstock
One thing to remember is that selectors are applied in order. $('td:nth(3):positive') gives you the positive numbers that are in the fourth cell, $('td:positive:nth(3)') gives you the fourth positive cell, probably not what you want Danny Wachsstock wrote: > > To sel

Re: [jQuery] adding a class to positive and negative data cells in a table column

2007-02-17 Thread Danny Wachsstock
To select specific elements, the cool kids all use custom selectors (not very well documented, but see http://docs.jquery.com/Plugins/Authoring#Using_jQuery.extend_to_extend_jQuery_itself and http://www.softwareunity.com/sandbox/JQueryMoreSelectors/ ) Basically, extend jQuery.expr[':'] with a str

Re: [jQuery] Creating an empty jQuery object

2007-02-17 Thread Danny Wachsstock
Wow. I leave my computer for 24 hours and I get answers from John Resig, Yehuda Katz and Mike Alsup. I love the jQuery community (and jQuery itself, of course). Mike: Yes, adding to an empty array then jQuery'ing it would work; it's how I originally structured my code. Adding to a jQuery better

Re: [jQuery] Creating an empty jQuery object

2007-02-16 Thread Danny Wachsstock
Yes, $('nonexistent-selector') works, but seems very inelegant. I think $([]) is the best solution, but I'd like to hear from the gurus. How much code depends on $() referring to document? Sam Collett wrote: > > On 16/02/07, Danny Wachsstock <[EMAIL PROTECTED]> w

[jQuery] Creating an empty jQuery object

2007-02-16 Thread Danny Wachsstock
I've been using jQuery for a few months now, trying to convert all my hand-rolled javascript and came across a minor problem that I could not find documented anywhere: I want to create DOM elements and add them into a jQuery object, as in; var result = [empty jQuery object]; $.each(... var elem

Re: [jQuery] Google's Summer of Code

2007-02-16 Thread Danny Wachsstock
I'd like to see a graphics plugin--porting Walter Zorn's wz_jsgraphics would be great. http://www.walterzorn.com/jsgraphics/jsgraphics_e.htm Danny John Resig wrote: > > Hey Everyone - > > Google's Summer of Code has just opened up for 2007, and I'd love to > have jQuery be a part of it: > htt

Re: [jQuery] onclick - toggle the creation of a TR?

2007-02-15 Thread Danny Wachsstock
ed so it looks > messy until the hide function kicks in to hide the detail rows. > > i m really not sure how to proceed with this. > > > Danny Wachsstock wrote: >> >> Try creating the element then using chaining to manipulate it: >> >> $("> clas

Re: [jQuery] onclick - toggle the creation of a TR?

2007-02-15 Thread Danny Wachsstock
Try creating the element then using chaining to manipulate it: $("").insertAfter(this).load(...).toggle(); But are you sure this is what you want? You'll end up creating a new row each time it's clicked, not toggling the old row. Why not create the (empty) description line when the table is crea

Re: [jQuery] Finding element that matches anchor link

2007-02-15 Thread Danny Wachsstock
oops. It should be $(/#.+$/.exec(this.href)[0]); Danny Danny Wachsstock wrote: > > I'm looking at the HTML specs > (http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#edef-A) > and hash doesn't look like a standard attribute. It seems to work for me >

Re: [jQuery] Finding element that matches anchor link

2007-02-15 Thread Danny Wachsstock
I'm looking at the HTML specs (http://www.w3.org/TR/1999/REC-html401-19991224/struct/links.html#edef-A) and hash doesn't look like a standard attribute. It seems to work for me in both IE and FF, but if it's not in the standard, your browser may not support it. You may be stuck with using the regu