[jQuery] Re: How to define/access public functions for a plugin?

2010-01-08 Thread Kevin Dalman
You could consider modifying your plugin to follow the jQuery UI Widget format. This takes advantage of the widget factory, which provides ways to access the methods and properties in 2 ways: 1) Through the element the plugin is applied to, eg: $("#myElement").smartList("selectedValue") 2) Or

[jQuery] Re: Prevent jagged text in IE

2009-10-08 Thread Kevin Dalman
@Dave > If this problem has a good fix, it should be fixed. There are several > cases that will break differently in IE when this proposed fix is > applied. It's not achieving consistent cross-browser behavior. There > may be a solution out there still, and if someone has one they should > post it

[jQuery] Re: keeping table header fix

2009-10-05 Thread Kevin Dalman
I create a lot of web-application list-screens with fixed-headers. I prefer to *not* work with a THEAD for this purpose because it is too limiting for complex page layouts. Instead, I create TWO tables - one for the headers and one for the content. This works well as long as you use table-layout:f

[jQuery] Re: LI.offset and LI.position() gives erratic results

2009-10-05 Thread Kevin Dalman
I have reposted this in the DEV forum... http://groups.google.com/group/jquery-dev/browse_thread/thread/16bd78710291bc93?hl=en#

[jQuery] LI.offset and LI.position() gives erratic results

2009-10-02 Thread Kevin Dalman
I am getting erratic results when trying to get the position of a LI element. Every browser gives different results - only IE7 seems to get it right... I have a navbar UL element nested a few levels deep within DIVs that provide page structure. The UL is also nested within a SPAN (inline- block)

[jQuery] Re: Prevent jagged text in IE

2009-09-30 Thread Kevin Dalman
@Dave > > with the "fix", fades out but then pops to 50% opacity I'm not sure why this 'fix' should be added to fadeOut? It seems most applicable to fadeIn and fadeTo. But whatever the case, a little extra code could handle edge-cases -- something like... if (jQuery.browser.msie && $(this).c

[jQuery] Re: Prevent jagged text in IE

2009-09-27 Thread Kevin Dalman
If browser-detection can't be used, then subsititute code to detect the "filter" attribute instead. The exact syntax is not important... I believe jQuery SHOULD handle this cross-browser animation issue because it is common to the majority of users. It is clearly a deficiency when jQuery's own co

[jQuery] Re: Prevent jagged text in IE

2009-09-26 Thread Kevin Dalman
@Rick > > if (jQuery.browser.msie) > this.style.removeAttribute('filter'); This is a nice simple solution to a common cross-browser issue, so wouldn't it be reasonable for this to be added to the standard jQuery animate method? The extra size is minimal. /Kevin On Sep 25, 5:17 pm, "Rick Fai

[jQuery] Re: Way to "convert" DOM event to jQuery event?

2009-09-24 Thread Kevin Dalman
If you need data for multiple fields, then a 3rd option is to create a single hash/data object for the page and writing all your data into that. This makes your data easy to read and debug, and is highly efficient because you don't have to 'parse' anything... var Record = { foo: "db-value-1"

[jQuery] Re: JSON data manipulation

2009-08-30 Thread Kevin Dalman
OOPS, I didn't formatted the data correctly for passing to Plot() - sorry, didn't read carefully. But the premise is the same - create an array by looping your data, and then pass the array when done. /Kevin On Aug 30, 9:04 am, Kevin Dalman wrote: > Hi Glenn, > > Create

[jQuery] Re: JSON data manipulation

2009-08-30 Thread Kevin Dalman
Hi Glenn, Create an array and 'push' each hash of plot data onto it. When the loop is complete, pass the now complete array... $.getJSON('/Graph/HearthRateDataJSON', "", function(data) { var data= [ ]; $.each(data, function(entryindex, entry) { data.push( { Name: entry['Name'], S

[jQuery] Re: event-binding to dynamically created elements... (JSP vs JS problem......)

2009-08-30 Thread Kevin Dalman
Good points by Josh. However this selector example... $('img[class="thumb"]).mouseover ...can be written simpler as $("img.thumb").mouseover It's faster in most browsers to select-by-class than to iterate elements and 'read attributes'. jQuery may process both syntaxes the same (?), but us

[jQuery] Re: Modify iframe with jquery

2009-05-15 Thread Kevin Dalman
If you cannot change the scrolling by modifying the iframe, then do it by modifying the document inside the iframe. I don't remember the syntax for accessing the document/body elements inside an iframe, so I'll just use pseudo-code here. You should be able to find the correct syntax easily... $(

[jQuery] Re: state of the art for corner rounding?

2009-05-03 Thread Kevin Dalman
I have not tried DD Roundies yet - it's on my todo list. Hoever I am using a jquery plug-in called 'Cornerz' that is working very well for me. It uses Canvas/VML for corners, but does not require any additional plug-ins: http://labs.parkerfox.co.uk/cornerz/ This plug-in does *not* automatically

[jQuery] Re: fadein thumbnails when loaded

2009-04-29 Thread Kevin Dalman
ilter: alpha(opacity=1); } Then in the HEAD of you page, add a STYLE block inside a NOSCRIPT block... #media-gallery ul li img { /* UNDO the opacity rule set previously */ opacity: 1; filter: alpha(opacity=100); } Just one more idea. /Kevin On Apr 29, 9:58 am, Kevin Dalman wrote:

[jQuery] Re: fadein thumbnails when loaded

2009-04-29 Thread Kevin Dalman
Hi Rick, Karl's suggestion seems the most elegant (assuming it works OK). Here is some sample code for what he is suggesting -- in HEAD or a stylesheet... body.js #media-gallery ul li img { /* opacity *may* work better than display:none */ opacity: 0.01; filter: alpha(opacity=1); }

[jQuery] Re: $('#foo p') or $('p', $('#foo'))

2009-02-28 Thread Kevin Dalman
For anyone interested, here is the updated set of 'tests' for the test page I posted previously. This is the test-set John is currently using: // Test # 1 start = new Date(); $Test = $("#div"+ myDiv +" p"); end = new Date(); a_Selectors.push('$("#div'+ myDiv +' p")'); a_Times.push(end - s

[jQuery] Re: $('#foo p') or $('p', $('#foo'))

2009-02-25 Thread Kevin Dalman
@John: I found a little bug in your v1.3.3 test version... This selector works fine in FireFox, but bombs out in IE7... $("#div50 p") IE7 --> "Object doesn't support this property or method" But this works fine: $("#div50 > p") NOTE that I'm pulling v1.3.3 directly from your personal c

[jQuery] Re: $('#foo p') or $('p', $('#foo'))

2009-02-25 Thread Kevin Dalman
That's a fantastic improvement. But now I have a new challenge - keep reading... To see if there really is a difference between the 2nd and 3rd options, or whether it is just 'variance', I cranked up the DIVs & Ps and tried both versions again: ALL tests below are in FireFox 3.0.6 --

[jQuery] Re: $('#foo p') or $('p', $('#foo'))

2009-02-25 Thread Kevin Dalman
FYI, I built a quick test page for this. As previously noted, the differences in v1.2.6 are relatively small - about 2x as long for one syntax over the other. But with 1.3.2 - Wow! - 60x longer! jQuery version used = 1.3.2 Total number of DIVs = 100 Paragraphs per DIV = 50 ---

[jQuery] Re: $('#foo p') or $('p', $('#foo'))

2009-02-25 Thread Kevin Dalman
John wrote: "You should always use $("#foo").find("p") in favor of $ ("p", $("#foo")) " I'm trying to extrapolate some general concepts from this 'rule'... First, I *assume* these two statements are identical in performance: $("p", $("#foo")) == $("p", "#foo") If so, then does it matter what t

[jQuery] Re: Optimize large DOM inserts

2009-02-08 Thread Kevin Dalman
Rick, based on what I've learned from testing, you have another option now... Here is a modified version of Mike's code - without generating the table. function populateDutyTable(response) { var currentDay = ''; var rows = response.QGETDUTYSCHEDULE.DATA; var out = []

[jQuery] Re: Optimize large DOM inserts

2009-02-08 Thread Kevin Dalman
I identified why the $("").append syntax is so extremely slow in the sample page. It actually has nothing to do with being a 'second DOM append' as was assumed. Here is what I learned from my testing... This is the HTML mark-up for the tests: I generated the same 'html' var

[jQuery] Re: Optimize large DOM inserts

2009-02-07 Thread Kevin Dalman
> * Instead of inserting a large number of sibling DOM elements (the TRs) > together, inserts only a single DOM element (the TABLE). > > Now it is very useful to know how much of the performance improvement is due > to each of these individual tricks, and thank you for doing that testing. My &

[jQuery] Re: Can JQuery solve the iframe height=100% problem?

2009-02-07 Thread Kevin Dalman
If you are going to apply a specific iframe height via script... $('#myIframe').css({height:$(this).parent('td').height()}); ...You MUST bind an event to window.resize to *re-size* the iframe whenever the browser window is resized. /Kevin On Jan 30, 10:58 am, jquertil wrote: > I think you're

[jQuery] Re: Can JQuery solve the iframe height=100% problem?

2009-02-07 Thread Kevin Dalman
Hi Dave, You've probably long-since moved on from this, but I stumbled across this topic again, so thought I'd answer anyway... There are lots of examples on the Layout website for creating a 'layout' around an iframe - use one of these as a starting point... http://layout.jquery-dev.net/demos/

[jQuery] Re: Optimize large DOM inserts

2009-02-07 Thread Kevin Dalman
These test pages DO NOT accurately compare the speed of array.join("") VS string+="...". The biggest speed difference between the two is REALLY that one uses $("") and one doesn't. If this is removed from the 'slow' page, the load-speed goes from 8.7 sec to 1.5 sec. This is still 6-times longer th

[jQuery] Re: Newb question about accessing a form's inputs

2009-02-07 Thread Kevin Dalman
Unless jQuery 1.3 has made vast improvement in the "name=Xxx" functionality, it is *horrendously slow*! I use a custom function to access form-fields - $F("fieldName") - which is up to 1000-times faster on large pages in my web-application. But this method is dependant on other custom methods, so

[jQuery] Re: Can jQuery calculate "CSS Width/Height"

2009-01-28 Thread Kevin Dalman
is width:90%; and I replace it with width:985px;, the width *would not change* (assuming 985 is the pixel equivalent). On Jan 26, 3:03 pm, Matt wrote: > $('#Test').css('width') ? > > On Jan 26, 11:46 am, Kevin Dalman wrote: > > > > > jQuery has inn

[jQuery] Re: Can JQuery solve the iframe height=100% problem?

2009-01-28 Thread Kevin Dalman
ot;).layout({ >                         closable:  false >                         ,  resizable: false >                         ,  spacing_open: 0 >                 }); >         }); > > src="file_tree.php" border="0" width="100%" scroll="auto"> > > but

[jQuery] Re: Reversing the SlideUp and SlideDown functions to slide from the bottom and not the top

2009-01-28 Thread Kevin Dalman
Use the effects in jQuery-UI when you need more than basic slideUp/ slideDown. Using show & hide with the appropriate options will allow you to slide in any direction. You also have a lot more effects to choose from then just 'slide' To open by sliding 'up', and close in reverse... $E.show( 'sli

[jQuery] Re: Can JQuery solve the iframe height=100% problem?

2009-01-26 Thread Kevin Dalman
(Sorry if this is a duplicate post) Hi Dave, This plugin may be more than you need, but... The UI/Layout widget will automatically position and size an iframe (or other element) to fill the entire page, OR allow for a header, footer, or sidebars. The code and markup are dead-simple. Here is an

[jQuery] Re: Can JQuery solve the iframe height=100% problem?

2009-01-26 Thread Kevin Dalman
Hi Dave, This plugin may be more than you need, but... The UI/Layout widget will automatically position and size an iframe (or other element) to fill the entire page, OR allow for a header, footer, or sidebars. The code and markup are dead-simple. Here is an example with a page-banner and an ifr

[jQuery] Can jQuery calculate "CSS Width/Height"

2009-01-26 Thread Kevin Dalman
jQuery has innerHeight/Width and outerHeight/Width methods, but is there a method that can return a 'CSS Height/Width'. A CSS width is the width that would be applied via CSS to achieve a given 'outer width'. This value will differ depending on the box model and other older browser idiosyncracies.