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

2009-09-23 Thread Ricardo Tomasi
Do you really need to output this data embedded in the HTML? Does it have any meaning/purpose without Javascript? There are two simple non- hackish ways you can do it: 1: load data later via XHR, use an element identifier to bind it 2: output metadata in the class attribute - it's valid, and not

[jQuery] Plugin development - how to access the current object from a "sub-method"?

2009-04-15 Thread Ricardo Tomasi
Supposing I have this: jQuery.fn.myPlugin = function(){ // }; jQuery.fn.myPlugin.myMethod = function(){ // ? }; $('#test').myPlugin.myMethod(); How can I access the current object or element collection from inside jQuery.fn.myPlugin.myMethod? Is it possible at all? thanks, - ricard

[jQuery] Re: How to surround All content after a specified HTML attribute H2?

2009-02-19 Thread Ricardo Tomasi
You can't insert invalid HTML into the DOM. Use the nextUntil plugin by John Resig (I'm starting to think this belongs in the core): $.fn.nextUntil = function(expr) { var match = []; this.each(function(){ for( var i = this.nextSibling; i; i = i.nextSibling ) { if ( i.node

[jQuery] Re: Creating callable methods, and binding them to objects' actions.

2009-02-19 Thread Ricardo Tomasi
I meant to say they are not required (when the value has no special characters). cheers, - ricardo On Feb 19, 1:02 pm, mkmanning wrote: > Missed the colon, the single quotes should be OK; the jQuery docs' > example even uses them: $("input[name='newsletter']") &

[jQuery] Re: Creating callable methods, and binding them to objects' actions.

2009-02-19 Thread Ricardo Tomasi
I don't think you need the colon in there (nor the single quotes) $("input[name=donation_type]") On Feb 19, 4:04 am, mkmanning wrote: > You shouldn't have to refer to the same object in different ways,  $ > ("input:[name='donation_type']") will work for both getting the value > and binding an e

[jQuery] Re: default value of an object's property

2009-02-18 Thread Ricardo Tomasi
or simply if (!Obj.sortby) Obj.sortby = 'time'; it's a bit more efficient. All of undefined, null, 0 or "" will evaluate to false, there's no need to check for each of them. Anyway, Alexandre, the ternary you posted should also work, there is probably something else wrong in your code. - ricardo

[jQuery] Re: insert div into group ordered by ID..

2009-02-18 Thread Ricardo Tomasi
I've since updated the script by request, it failed if you began with a single element in the container. It now sorts by any attribute you want (ids by default) and works with multiple elements both ways. http://ff6600.org/j/jquery.insertInOrder.js Examples at: http://jsbin.com/itofi http://jsbi

[jQuery] Re: Using jQuery.noConflict() with Prototype/Scriptaculous

2009-02-18 Thread Ricardo Tomasi
I find it more practical to use an anonymous function as in (function ($){..}(jQuery) and keep the '$' reference, or do all the work at once to avoid confusion: (function($){ $(...) })( jQuery.noConflict() ) or jQuery.noConflict()(function($){ $(...) }); On Jan 7, 4:55 am, seasoup wrote:

[jQuery] Re: Order Items. Please help me. Thank You.

2009-02-17 Thread Ricardo Tomasi
it to the list. > > > Could someone, please, help me out with this? > > > Basically, every time I add or remove an item I need to reorder the > > names of the input fields. > > > Please check my original message on this post. It explains the > > si

[jQuery] Re: Minified and Gzip?

2009-02-17 Thread Ricardo Tomasi
How are you checking it? The 'Net' tab in Firebug should tell you if it's gzipped or not. On Feb 17, 10:00 pm, ScottChiefBaker wrote: > How do I setup JQuery to be server Gzipped? Using apache I installed > mod_deflate and set it up to serve .js files as gzipped, but it > doesn't seem to be work

[jQuery] Re: Exploding nested s....

2009-02-17 Thread Ricardo Tomasi
What do you mean by "explode"? remove? On Feb 17, 4:50 pm, "webspee...@gmail.com" wrote: > Hey all. > > Exploding a simple is easy enough, but can you explode nested > s? I have a div container and inside it I have content generated > from an AJAX call. When I explode the outer div, I don't get

[jQuery] Re: element selection

2009-02-17 Thread Ricardo Tomasi
Probably $('#'+id).remove(). It's an usual string. On Feb 17, 3:56 pm, Ashit Vora wrote: > Hi, > I 've a small query, I have a table with each row having a unique id > (eg. 1,2,3,4) > > As an Ajax response I receive ID in JSON format. > > I want to remove the row having that ID. > > For sele

[jQuery] Re: $.getScript fatal error with XML.

2009-02-17 Thread Ricardo Tomasi
the URL is on a remote > server, $.get isn't working.  I may have to use $.ajax. > > On Feb 17, 2:01 am, Ricardo Tomasi wrote: > > > getScript is, as it's name says, for getting scripts. What happens > > when you use the code below? > > > $.get(getURL, fu

[jQuery] Re: $.getScript fatal error with XML.

2009-02-17 Thread Ricardo Tomasi
getScript is, as it's name says, for getting scripts. What happens when you use the code below? $.get(getURL, function(xml){ alert(xml); }); On Feb 17, 3:33 am, Kuma Pageworks wrote: > I posted about this before, but the response didn't help - so I > thought I'd try posting again. > > I hav

[jQuery] Re: getting ul html on each and appending to div problem

2009-02-16 Thread Ricardo Tomasi
$("ul").each(function() { var ulla = jQuery(this).html(); //ulla is a 'private' variable here, it's only available inside this function. that's why it's undefined. }); This should work: jQuery(function($){ var items = $('#la ul').remove().find('li'); $("#la dl").empty().append( items );

[jQuery] Re: how to zebra stripe divs?

2009-02-16 Thread Ricardo Tomasi
The code in your test page still reads $("div:.postSummary (odd)").addClass("odd"), not $("div.postSummary:odd").addClass("odd"); On Feb 17, 12:04 am, mark law wrote: > Thanks MorningZ :), yes that is the one I'm trying to mimic. "odd" is only > declared in: > > $("div.postSummary-teaser:odd").a

[jQuery] Re: Permission denied to get property HTMLDivElement.parentNode

2009-02-16 Thread Ricardo Tomasi
Some live samples would be very useful. You probably mean jQuery 1.3.1 right? On Feb 16, 11:58 am, David wrote: > Usually I also get that error, Permission denied to get property > HTMLDivElement.parentNode, just loading HTML with a few jquery lines > of code. I have to refresh the web page (F5)

[jQuery] Re: jQuery in PCs

2009-02-16 Thread Ricardo Tomasi
Isn't Google Gears also storing local copies of popular libraries? Hopefully that will be standard practice when HTML 5 comes along. - ricardo On Feb 15, 10:04 pm, "Michael Geary" wrote: > That's a neat idea; thanks for thinking about improving load time. > > We may actually have something a bi

[jQuery] Re: selector best practice

2009-02-16 Thread Ricardo Tomasi
Not going to native methods I'd say the fastest selector without an ID would be $("#tableid td.cellclass") as that will call getElementByID and getElementsByTagName/getElementsByClassName from the #tableid context (or querySelectorAll). Anyway, you only need to add more selectors if you want to en

[jQuery] Re: Working with identical objects

2009-02-15 Thread Ricardo Tomasi
Sorry for the double messages. Actually that could simply be: alert( jQ(this).val() ) as val() called on a will return the selected option's value. On Feb 15, 6:04 pm, Ricardo Tomasi wrote: > That's quite a lot of code to read through in an email. Try reducing > your c

[jQuery] Re: Working with identical objects

2009-02-15 Thread Ricardo Tomasi
That's quite a lot of code to read through in an email. Try reducing your code to the least necessary to exemplify your problem, then someone might take the time to help. >From what I see: alert(jQ("option:selected", ModulesListObj).val()) This is catching all the selected options inside Modules

[jQuery] Re: anyone tried alternatives to setting wmode on objects (lightbox on top issue)?

2009-02-15 Thread Ricardo Tomasi
If I recall correctly you can stack an iframe of your own over the whole page (behind the lightbox) that will stay on top of everything. In the last project I needed to work around this, I just set visibility:hidden for all flash/iframe objects in the page when firing a lightbox. Not very noticeab

[jQuery] Re: strange loop with livequery click

2009-02-15 Thread Ricardo Tomasi
The point of livequery is you don't need to reattach the listeners everytime you add new elements. This line: $("li.reItem").livequery('click', function(event){ should be ran only once on $().ready(), not everytime you call loadForecast(). You're basically adding a new 'click' listener everytime

[jQuery] Re: Feature Detection Best Practice?

2009-02-15 Thread Ricardo Tomasi
I thought that was the point of $.support - If it doesn't support the standard implementation, then it's false. On Feb 14, 8:46 pm, Klaus Hartl wrote: > On 14 Feb., 20:31, Chris wrote: > > > On Feb 13, 2:34 am, Klaus Hartl wrote: > > > > That will not avoid IE's ClearType issue, since IE is su

[jQuery] Re: optimizing

2009-02-15 Thread Ricardo Tomasi
Saving the elements beforehand (if they're not gonna change), rolling your own loop and doing only what is necessary inside it should increase performance already. I'm sure there are faster ways, knowing how the HTML is structured you could speed up the element look-ups too. $(document).ready(fun

[jQuery] Re: Would some please tell me what's wrong with this syntax?

2009-02-13 Thread Ricardo Tomasi
function getNewSchedule(response.MONTH, response.YEAR) { the parameteres when you declare a function are variable names, and those are invalid. Try function getNewSchedule(month, year) { and replace the response.XX references inside the function accordingly. You can then call the function pas

[jQuery] Re: Is there a way to make a textarea that auto expands as needed?

2009-02-12 Thread Ricardo Tomasi
textarea that auto expands as > needed? > > If Ricardo's solution doesn't work for you, you could try Brandon Aaron's > plugin. > > http://github.com/brandonaaron/jquery-expandable/tree/master > > --Karl > > > > Karl Swedberg > >

[jQuery] Re: Browser locking up -- please help!

2009-02-12 Thread Ricardo Tomasi
Any other scripts on the page? What does the HTML looks like? Try putting a complete version at jsbin.com exhibiting the lock-up, nothing looks wrong in the code you posted. cheers, - ricardo On Feb 12, 3:25 pm, Shane wrote: > Thanks for Viewing, > > I have one page that locks up all browsers

[jQuery] Re: how to fade in image after the site loads?

2009-02-12 Thread Ricardo Tomasi
The 'load' event doesn't fire in Internet Explorer if the image is cached, maybe that's why. $('#photo img').bind('load readystatechange', function(e) { if (this.complete || this.readyState == 'complete' && e.type = 'readystatechange') { $('.pic').fadeIn(); $('div.position').fadeOut();

[jQuery] Re: New to JQuery, silly question.

2009-02-12 Thread Ricardo Tomasi
li:last and li.last are not the same element. li.last is the element, while li:last is giving you the *last* LI in the collection of *all* the LI's descending from ".leftNav ul" - that is the HAX element. Enforcing the child relationship should give you the expected results: $(".leftNav .menu

[jQuery] Re: New to JQuery, silly question.

2009-02-12 Thread Ricardo Tomasi
I guess it's something else in your code that is going wrong. I just copied and pasted your JS and HTML and it works fine: http://jsbin.com/ibete http://jsbin.com/ibete/edit Can you post a test page like the one your working, showing this issue? Then I'm sure someone will spot the problem. chee

[jQuery] Re: Finding the last sibling.

2009-02-12 Thread Ricardo Tomasi
> descendant elements (e.g.  if there were an inside the span in > > your example it would be returned too). You can also not worry about > > the parent at all and just use the sibling selector: > > >  //or you could use :last-child > > > As Ricardo suggested,

[jQuery] Re: Removing all styles from an element-

2009-02-12 Thread Ricardo Tomasi
ic Luciano wrote: > I considered it, but because of the ambiguity I run into I just need > to specify every single Css property... Thought there might be   > something clever I could do with jquery but pobably not... Thanks > > Sent from my iPhone > > On Feb 12, 2009, at 12:0

[jQuery] Re: Is there a way to make a textarea that auto expands as needed?

2009-02-12 Thread Ricardo Tomasi
Did you skip my previous message? On Feb 12, 11:02 am, "Rick Faircloth" wrote: > Ideas, anyone? > > > -Original Message- > > From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On > > Behalf Of Rick Faircloth > > Sent: Wednesday, February 11, 2009 6:56 PM > > To: jquery

[jQuery] Re: A small incompatibility about selector on Jquery 1.3.1

2009-02-11 Thread Ricardo Tomasi
Try $('#zz input[readonly=]:first') There are a few selector bugs in 1.3.1. Most have already been fixed for 1.3.2. cheers, - ricardo On Feb 12, 12:53 am, jack wrote: > The following works on before Version: > $('#zz input:not([readonly]):first').focus().select() > > On Ver 1.3.1, it won't wor

[jQuery] Re: Finding the last sibling.

2009-02-11 Thread Ricardo Tomasi
$(this).parent().children(':last') //or :last-child - assuming 'this' is the input element On Feb 12, 3:09 am, Risingfish wrote: > Thanks Nic, > > How about if I'm using the input tag as the base? Can I do something > like $("self:parent:last-child") ? > > On Feb 11, 8:13 pm, Nic Luciano wrote:

[jQuery] Re: Removing all styles from an element-

2009-02-11 Thread Ricardo Tomasi
You could a use kind of "CSS reset" for your container. I usually don't like '*' declarations but this seems fit here: #myModule * { margin:0; padding:0; font-family:Arial; color:#000; height:auto; width:auto } On Feb 11, 11:09 pm, Nic wrote: > The scenario: I am developing a module that will l

[jQuery] Re: Is there a way to make a textarea that auto expands as needed?

2009-02-11 Thread Ricardo Tomasi
My guess would be to count the character number on keypress and increase height accordingly. var $text = $('textarea'), oHeight = $text.height(), cols = +$text.attr('cols'), lineHeight = parseInt($text.css('line-height')); $text.bind('keypress', function(){ ln = $text.val().length, m = ln

[jQuery] Re: Order Items. Please help me. Thank You.

2009-02-11 Thread Ricardo Tomasi
Probably not the most efficient function, but should work: $('#ThemesList li').each(function(index){ $('input:hidden', this).each(function(){ var fixName = $(this).attr('name').replace(/\[\d\]/, '['+index +']'); $(this).attr('name', fixName); }); }); - ricardo On Feb 11, 7:19

[jQuery] Re: Is A Child Of?

2009-02-11 Thread Ricardo Tomasi
ve a few ms, and memory: > *** > jQuery.fn.childOf = function(a){ >    this.each(function(){ >       if (this.parentNode == a) return true; >        }); >    return false;}); > > ******* > > On Feb 11, 8:18 pm, Ricardo Tomasi wrote: > > &g

[jQuery] Re: Replace part of a src= value

2009-02-11 Thread Ricardo Tomasi
Looks like we posted at the exact same time! :] Correcting myself again: you should really use the regex, as the simple string replace is case-sensitive. On Feb 11, 5:40 pm, Ricardo Tomasi wrote: > That's a simple Regular Expression (present in most programming > languages, not ju

[jQuery] Re: Replace part of a src= value

2009-02-11 Thread Ricardo Tomasi
That's a simple Regular Expression (present in most programming languages, not just JS) that does a case-insensitive (/i) for '.png' at the end ($) of the string. See here: https://developer.mozilla.org/en/Core_JavaScript_1.5_Guide/Regular_Expressions You might want to filter the img elements f

[jQuery] Re: trigger click event of anchor endless recursion

2009-02-11 Thread Ricardo Tomasi
add event.stopPropagation() to the click listener function on , that way it won't fire the click for the parent TD. - ricardo On Feb 11, 3:40 pm, johnallan wrote: > jquery 1.3.1 > > jq("#miniCalendarTable td").hover( >         function(){ jq(this).addClass("hover") }, >         function(){ jq(t

[jQuery] Re: Increment Value. What am I doing wrong?

2009-02-11 Thread Ricardo Tomasi
ote: > On Wed, Feb 11, 2009 at 1:23 PM, Ricardo Tomasi wrote: > > > Increment/decrement is for variables. You can't use it directly on a > > number. Try '3--'. > > > Make it simple, if you use subtraction the type conversion is done for > > you: &g

[jQuery] Re: Safe Ajax Calls?

2009-02-11 Thread Ricardo Tomasi
$('.aj-link').click(function(){ var page = $(this).attr('href'); $('#targetDIV').load('ajax/'+page+'nocache='+Math.random()); }); http://docs.jquery.com/Selectors http://docs.jquery.com/Events http://docs.jquery.com/Ajax On Feb 11, 10:40 am, SoulRush wrote: > I though that it would be nic

[jQuery] Re: Select all even row in table that are not with a specified class.

2009-02-11 Thread Ricardo Tomasi
Yes, you can. In doubt, just try it, it doesn't hurt :) $("table.font_quotazioni tr:odd:not(.highlight,.midlight)").addClass ("even"); $("table.font_quotazioni tr:odd:not(.highlight):not (.midlight)").addClass("even"); $("table.font_quotazioni tr:odd").not(".highlight, .midlight").addClass ("even

[jQuery] Re: using :has with selector

2009-02-11 Thread Ricardo Tomasi
Try doing it in two steps: $("#tableid tbody tr:has(td.someclass)").filter(':contains (mytext)').doSomething() On Feb 10, 7:57 pm, SteelRing wrote: > Anyone can think of a reason why this shouldn't work? I'm trying to > select the Row (tr) where the cell of td with class "someclass" > contains

[jQuery] Re: document.createComment usage - can be improved?

2009-02-11 Thread Ricardo Tomasi
It's part of the DOM Level 1 specs, should be supported by all current browsers: http://www.w3.org/TR/REC-DOM-Level-1/level-one-core.html#method-createComment You can overwrite it though, document.createComment = null || anything; On Feb 11, 8:20 am, Marc Palmer wrote: > Hi, > > I'm new to jQu

[jQuery] Re: Safe Ajax Calls?

2009-02-11 Thread Ricardo Tomasi
*and don't forget to return false or do e.preventDefault() $('.aj-link').click(function(){ var page = $(this).attr('href'); $('#targetDIV').load('ajax/'+page+'nocache='+Math.random()); return false; }); On Feb 11, 4:57 pm

[jQuery] Re: Increment Value. What am I doing wrong?

2009-02-11 Thread Ricardo Tomasi
Increment/decrement is for variables. You can't use it directly on a number. Try '3--'. Make it simple, if you use subtraction the type conversion is done for you: $index = $('#Index'); val = $index.val()-1; On Feb 11, 2:37 pm, shapper wrote: > You mean the following: > >         $index = $('#

[jQuery] Re: Is A Child Of?

2009-02-11 Thread Ricardo Tomasi
You can shave a few ms off that by using the current object itself, and cacheing the other element: jQuery.fn.in = function(a){ var a = $(a)[0]; return !!this.parents().filter(function(){ return this === a;}).length; }; Also be aware that this actually checks if the element is a *descendant*

[jQuery] Re: jQuery / FF3 problem using "show()"

2009-02-10 Thread Ricardo Tomasi
>From the docs: Note: Please make sure that all stylesheets are included before your scripts (especially those that call the ready function). Doing so will make sure that all element properties are correctly defined before jQuery code begins executing. Failure to do this will cause sporadic probl

[jQuery] Re: The order of these conditions should not matter

2009-02-10 Thread Ricardo Tomasi
howCheck(); > > This is very problematic. If I remove the second line, the first line > works as expected, and I observe the same behavior when I try these > conditionals reverse order (Check first, causing CC to always override > it). > > Thomas > > On Feb 10, 2:23 pm,

[jQuery] Re: The order of these conditions should not matter

2009-02-10 Thread Ricardo Tomasi
What do you mean by overriden? Just copied your code over and it seems to work fine. http://jsbin.com/efeje http://jsbin.com/efeje/edit - ricardo On Feb 10, 3:07 pm, Thomas Allen wrote: > Here's my JS:http://pastebin.com/m6091a365 > And the accompanying HTML:http://pastebin.com/m30c57ea6 > > F

[jQuery] Re: Next/Previous element in each loop

2009-02-09 Thread Ricardo Tomasi
e/my example) so you'll most likely want to check for > > that. > > > On Feb 9, 1:23 pm, Ricardo Tomasi wrote: > > > > You can take advantage of the index passed to each. What you posted is > > > very close to working: > > > > $(function() {

[jQuery] Re: Access DOM cross-domain

2009-02-09 Thread Ricardo Tomasi
Why not simply use escaped plain text? On Feb 9, 6:04 pm, jay wrote: > I'm playing around with writing a server-side script that generates > JSONP from content that is downloaded by the script (URL is passed to > script from querystring).  Is there a better way to do it than to > encode it as ba

[jQuery] Re: Passing a Index to a function

2009-02-09 Thread Ricardo Tomasi
$("table tr").each(function( index ){ $(this).click(function(){ alert('I am TR number ' + index); }); }); the index() function works on a collection of elements, so you'd have to get them first: $('table tr').click(function(){ alert( $(this).parent().children().index(this) ); }); On

[jQuery] Re: Next/Previous element in each loop

2009-02-09 Thread Ricardo Tomasi
You can take advantage of the index passed to each. What you posted is very close to working: $(function() { var divs = $("div"); divs.each(function(i){ var prev = divs.eq(i-1).text(); var next = divs.eq(i+1).text(); alert(prev + " - " + next); }); }); There's no nee

[jQuery] Re: New jQuery Conditional Chain Plugin

2009-02-09 Thread Ricardo Tomasi
I still prefer the old ternary operator way: $.ajax('url.php', function(data){ $('#result').addClass(data.success ? 'ui-state-highlight' : 'ui- state-error'); }, 'json'); Any possibilities I'm missing here? On Feb 9, 5:12 pm, Eric Garside wrote: > Hey guys, > > I had an idea this morning wh

[jQuery] Re: jquery, OOP and this - Problem

2009-02-09 Thread Ricardo Tomasi
Oh, I thought setContent() was one of his class' methods. Does it make sense to do something like this.slide=function() {.. on a jQuery object? On Feb 9, 5:57 pm, Eric Garside wrote: > Yea, the scope should be fine. You just have to wrap "this" in "$()" > when using the reference to the element.

[jQuery] Re: jquery, OOP and this - Problem

2009-02-09 Thread Ricardo Tomasi
just stay aware of the scope: var oldthis = this; this.slide=function(){ $(this.container_selector_contents).fadeOut(1000, function(){ oldthis.setContent(); oldthis.fadeIn(1000) }); } ; On Feb 9, 3:13 pm, Creativebyte wrote: > Hello group, > > I got a problem

[jQuery] Re: Does it hurt to call functions that don't do anything on the page?

2009-02-09 Thread Ricardo Tomasi
; I guess you have your $().ready()functionin an external js file, > > > > > otherwise you could > > > > > customize it for the according html page. > > > > > > Another construct similar to Ricardos one, but a bit more flexible: > > > > > &g

[jQuery] Re: selector to return the number of rows in a table before the row I just selected

2009-02-08 Thread Ricardo Tomasi
you should be looking at http://docs.jquery.com/Traversing var currentRow = $('table tr').eq(7); var howManyBefore = currentRow.prevAll('tr').length; cheers, - ricardo On Feb 8, 3:23 pm, pantagruel wrote: > Hi, > > I am selecting the row of a table. I would like to be able to count > how many

[jQuery] Re: Help : Difficulty binding event to selected jQuery object

2009-02-08 Thread Ricardo Tomasi
Maybe it's just a typo, but you're creating a div with the ID "toolbar_button_target" ...prepend("... and then calling it with a class selector: $(".toolbar_button_target") is that right? On Feb 7, 5:38 pm, James S wrote: > Dear jQuery, > >  Can find plenty of discussion on the use of liveq

[jQuery] Re: Does it hurt to call functions that don't do anything on the page?

2009-02-07 Thread Ricardo Tomasi
Checking for the presence of a relevant element should do: $(document).ready(function(){ if ( $('#categories').length ) ManageCategoriesClick(); if ( $('#ghosts').length ) HideByDefault(); if ( $('#split').length ) PrepareSplitForm(); }); Alternatively you could add a

[jQuery] Re: Optimize large DOM inserts

2009-02-07 Thread Ricardo Tomasi
laceHTML to work on inserting HTML > > into the DOM though. Using the previous suggestions, it would become: > > replaceHtml('myElementID', out.join('')); > > > but the inserted HTML in 'myElementID' had all of the HTML tags (, > > , etc.) stripp

[jQuery] Re: how to change the iframe src

2009-02-06 Thread Ricardo Tomasi
$('connectframe'+'iframe') should be $('#connectframe'+' iframe') (notice the whitespace) and so on.. On Feb 6, 7:34 pm, cindy wrote: > Hi, > > what I want to do is to change iframe src, when click the tab. The > click function is called, but the iframe src is not changed at all. Do > you know

[jQuery] Re: Optimize large DOM inserts

2009-02-06 Thread Ricardo Tomasi
html > > > Try them in IE, where the performance is the worst and matters the most. > > > On my test machine, the first one runs about 6.3 seconds and the second one > > about 0.13 seconds. > > > -Mike > > > > From: Ricardo Tomasi > > > > Con

[jQuery] Re: Jquery plugin localisation nightmare

2009-02-06 Thread Ricardo Tomasi
27;frForRegex': 'frForNone', > 'frForAlertText': '* Ce champs est requis'}}; > > } > > Working like that will allow you to create a fully localized plugin. > If you just want to localize some output strings, and not the actual > function n

[jQuery] Re: Jquery plugin localisation nightmare

2009-02-06 Thread Ricardo Tomasi
allRules appears to be a var (global?) inside the validationEngine function, not a property. Isn't it easier to just rewrite the whole validation js? On Feb 6, 12:46 pm, Karnius wrote: > Hi guys, I got a plugin I want to do the localisation in french. I > decided to go with a similar solution of

[jQuery] Re: Optimize large DOM inserts

2009-02-06 Thread Ricardo Tomasi
and matters the most. > > On my test machine, the first one runs about 6.3 seconds and the second one > about 0.13 seconds. > > -Mike > > > From: Ricardo Tomasi > > > Concatenating into a string is already much faster than > > appending in each loop, there is

[jQuery] Re: Scoping, Closure and $.post

2009-02-05 Thread Ricardo Tomasi
renderTree: function(){ var tree = this; $.post("/Treeview?task=GET_NODE&action=DYNAMIC", {}, function() { tree.renderFolder(xml, 'foldersView'); }); }, On Feb 5, 5:54 pm, MoBel wrote: > I'm integrating prototype and jQuery together.  I have a class that > looks like this: > > var

[jQuery] Re: Optimize large DOM inserts

2009-02-05 Thread Ricardo Tomasi
Concatenating into a string is already much faster than appending in each loop, there is not much room for improvement left. What you can do improve user experience though is split that into a recursive function over a setTimeout, so that the browser doesn't freeze and you can display a nice loadi

[jQuery] Re: Optimize large DOM inserts

2009-02-05 Thread Ricardo Tomasi
Concatenating into a string is already much faster than appending in each loop, there is not much room for improvement left. What you can do improve user experience though is split that into a recursive function over a setTimeout, so that the browser doesn't freeze and you can display a nice loadi

[jQuery] Re: Can i use selector to reach "slice" in jQuery 1.3?

2009-02-05 Thread Ricardo Tomasi
It's much faster (and clearer) to use slice(): $('.button').slice(1,3); On Feb 5, 12:56 pm, Stephan Veigl wrote: > Hi > > that selector works just as it should. If you get other results in > JQuery 1.2.6, then there was a bug in 1.2.6. > What you ask for is: >  1. give me every element of class

[jQuery] Re: How can I extract the index of an item based within a table?

2009-02-05 Thread Ricardo Tomasi
Correction: you actually need the children collection to work out the index: var index = $(this).parent('tr').children().index(this); On Feb 5, 5:01 am, Ricardo Tomasi wrote: > var index = $(this).parent('tr').index(this); > var quantity = $('.price_table

[jQuery] Re: Having problems getting index() and closest() to work

2009-02-05 Thread Ricardo Tomasi
duplicate: http://groups.google.com/group/jquery-en/browse_thread/thread/1b8e73583661fa52/ec7d0d275d484f66?hl=en#ec7d0d275d484f66 On Feb 5, 9:19 am, paulswansea wrote: > Hi, > > I have a page with multiple tables, and need to get the index value of > a cell with a price which i click on, so i ca

[jQuery] Re: Jquery adds its own tags to divs???

2009-02-04 Thread Ricardo Tomasi
You see them in IE Developer Toolbar, right? These are unique identifiers for elements, serves the data() function and others. On Feb 4, 11:57 pm, Andy789 wrote: > Hi All, > > I cannot understabd why jquery adds these tags to my divs - something > like: > > jquery1233798431484="2" jquery12337982

[jQuery] Re: How can I extract the index of an item based within a table?

2009-02-04 Thread Ricardo Tomasi
var index = $(this).parent('tr').index(this); var quantity = $('.price_table th').eq(index).text(); alert( quantity ); On Feb 4, 9:45 pm, paulswansea wrote: > Hi, > > I'm trying to write some jquery code so when i click on the relevent > item price, it alerts me with the quantity of that item an

[jQuery] Re: setting focus to the first empty field

2009-02-04 Thread Ricardo Tomasi
$('[value=""]') seems to be broken in 1.3.1 (fixed in the nightlies, see http://dev.jquery.com/ticket/3990), so that would be $('form input[value=]:first').focus(); cheers, - ricardo On Feb 4, 7:38 pm, Klaus Hartl wrote: > $('form input[value=""]:first').focus(); > > --Klaus > > On 4 Feb., 20:

[jQuery] Re: .eq(variable) strange behaviour

2009-02-04 Thread Ricardo Tomasi
menuLoading(currentMenuItem,menuLength) --> with this you're calling the function instantly, not passing it as a callback. You can't pass parameters to the callback this way, use local vars instead. Also you should increase the currentMenu var only after you've chosen the current one. $('.menu li

[jQuery] Re: stilted animation in all browsers except Chrome & Opera

2009-02-04 Thread Ricardo Tomasi
The page doesn't load at all in IE7: "Warning: simplexml_load_file() [function.simplexml-load-file]: ^ in E: \domains\a\antoniocaniparoli.co.uk\user\htdocs\wip1\antonio.php on line 4" and other errors. On Feb 4, 3:15 pm, Barney wrote: > Hi all! > > Having a great adventure of my first jQuery w

[jQuery] Re: having a problem with ' and strings

2009-02-04 Thread Ricardo Tomasi
My friend Mauricio Samy pointed out a mistake I made: attributes enclosed in single quotes are actually valid in XHTML/XML. I'm used to single quotes as a standard for JS, and double ones for XHTML, makes code clearer in both. cheers, - ricardo On Feb 4, 3:56 pm, Ricardo Tomasi

[jQuery] Re: Change subdomain on same page...

2009-02-04 Thread Ricardo Tomasi
The usual way that's done is via the URL hash: http://adamkobrin.com/#about location.hash == '#about' - ricardo On Feb 4, 3:50 pm, atomk wrote: > I have different subdomains pointing to the same file on my server - > simple enough. What I'd like to do is essentially reverse that: Can > the sa

[jQuery] Re: having a problem with ' and strings

2009-02-04 Thread Ricardo Tomasi
Replace all quotes inside your text variables with their correspondent HTML entities, then you should face no issues: titleFull = titleFull.replace("'","‘").replace('"',"""); I agree with Liam, it's best to use single quotes for the strings passed so you can use double quotes inside them. In XHT

[jQuery] Re: a tag with good text popup (without title)

2009-02-04 Thread Ricardo Tomasi
Look for 'tooltip' at plugins.jquery.com This is the first result on google: http://www.codylindley.com/blogstuff/js/jtip/ On Feb 4, 12:35 pm, Petty Pavlow wrote: > Hi > I would like to do some html (a tag) links.When u go with mouse on the > top of this link it will pop up a box with      (may

[jQuery] Re: A couple of jQuery questions (recent converter from Prototype to jQuery)

2009-02-04 Thread Ricardo Tomasi
Hi and welcome to jQuery :] A simple but not very effective way to do that is $ ('#myelement').parents('body').length, or, if you are sure you're dealing with a single element, a check for $('#myel')[0].parentNode would suffice. You can also implement this as a plug-in: jQuery.fn.inDOM = functi

[jQuery] Re: Is this list too busy? jQuery list for your time zone

2009-02-04 Thread Ricardo Tomasi
I opted for the daily digest mail. I just take a look at the messages' subjects and choose what I want to read, works quite well, I don't waste any time. - ricardo On Feb 4, 10:16 am, boermans wrote: > The time when I at least skimmed every message on this list in long > gone. > As jQuery becom

[jQuery] Re: getscript without parameters... an alernative?

2009-02-04 Thread Ricardo Tomasi
Actually after the document has loaded, any function passed to $ (document).ready() will fire immediately. Also functions are called in the order they were added, so you can put it inside the getScript callback like this: $(document).ready(function(){ x = function(d){ alert(d) }; }); $.getScr

[jQuery] Re: Performance suggestion: Use object hash instead of regexp

2009-02-03 Thread Ricardo Tomasi
I think this should be posted at jquery-dev. There is no significant difference between the hash and switch options, less than 10ms for 200.000 iterations (FF3). But both offer a solid speed improvement over a simple regex in the case posted when dealing with hundreds of calls. That could be impor

[jQuery] Re: How to enlarge size proportionally

2009-02-03 Thread Ricardo Tomasi
$('#anim').animate({marginLeft: '-=50', width: '+=100'}); or $('#anim').css('position', 'relative').animate({left -50, width: '+=100'}); On Feb 3, 1:11 pm, Eric Garside wrote: > Hmm. Lets say you need it to grow 100px. Would: > > $('#anim').animate({paddingLeft: 50, width: 50}); > > work? It's h

[jQuery] Re: about :not(:last)

2009-02-03 Thread Ricardo Tomasi
y will have it's first point to leave it as soon as > a better library appears > > I can do anything more that change my code to solve this jQuery bug > but this don't change the fact that there is a bug at jQuery > > Thanks > > On 3 feb, 02:32, Ricardo Tomasi wrote:

[jQuery] Re: about :not(:last)

2009-02-02 Thread Ricardo Tomasi
he divs inside the dt element to put a label, the > icon and the other div to switch between visible/non visible dd > > How do you think I could put my markup to avoid this problem? > > I don't like your suggest because one of the main reasons to change > from prototype to jquer

[jQuery] Re: block on body onload, unblock on at the end of $(document).ready

2009-02-02 Thread Ricardo Tomasi
#x27;body').unblock() > > it works, but I wonder if there is something i missed? > > best. > > On Feb 2, 11:11 am, Ricardo Tomasi wrote: > > > the 'onload' event actually fires after document ready - that's the > > reason doc ready exists! > > &

[jQuery] Re: How to get html string including the selected element

2009-02-02 Thread Ricardo Tomasi
Oops, wrong URL. This is the right one: http://plugins.jquery.com/project/outerhtml On Feb 2, 9:59 pm, Ricardo Tomasi wrote: > Try this: > > http://yelotofu.com/2008/08/jquery-outerhtml/ > > On Feb 2, 7:13 am, Andy789 wrote: > > > Hi All, > > > I need to get h

[jQuery] Re: How to get html string including the selected element

2009-02-02 Thread Ricardo Tomasi
Try this: http://yelotofu.com/2008/08/jquery-outerhtml/ On Feb 2, 7:13 am, Andy789 wrote: > Hi All, > > I need to get html for a dom structure like this: > > > something > > > > if I use > > $('div#test').html(); > > it generates its innerHTML excluding > > How an I get the whole structure

[jQuery] Re: Can't select an id containing '/' ?

2009-02-02 Thread Ricardo Tomasi
You have to escape special characters with a double backslash: $('#\\/about\\/') On Feb 2, 4:35 am, starmonkey wrote: > Using jQuery 1.2.6, it would seem that any id containing a forward > slash cannot be selected using jQuery's syntax: > > testing blah > testing about > testing about2 > testin

[jQuery] Re: simple jQuery img src Question

2009-02-02 Thread Ricardo Tomasi
orks! THanks! > > On Jan 21, 11:35 pm, Ricardo Tomasi wrote: > > > A cross-browser way of doing that: > > > $('img').fadeOut(500, function(){ > >   $(this).attr('src',newsrc).bind('onreadystatechangeload', function() > > { >

[jQuery] Re: callback for append function?

2009-02-02 Thread Ricardo Tomasi
Take notice that the image's load event doesn't always fire in IE. You have to use .bind('readystatechange load', loaded) function loaded(){ if (this.complete) // or if (this.readyState == 'complete') //do stuff to guarantee that the function will be called (the .complete property is always

[jQuery] Re: jQuery + iPhone, improving element animations

2009-02-02 Thread Ricardo Tomasi
The best approach for the iPhone would be to use CSS3 animations, they run much smoother. Also, have you seen jQuery touch? Might be useful: http://www.manifestinteractive.com/iphone/touch/ On Feb 2, 7:04 pm, persilj wrote: > I tend to create versions for different platforms and frameworks from

  1   2   3   4   >