[jQuery] Re: Selector Efficiency?

2009-03-02 Thread Stephan Veigl
measurement code - one reason for the question in the first place was not knowing how to measure speed.  The sample helps a lot. Thanks a lot, and sorry for the delay in responding, Josh On Thu, Feb 19, 2009 at 5:12 AM, Stephan Veigl stephan.ve...@gmail.com wrote: Hi Josh, are your data

[jQuery] Re: jQuery validation question: validating multiple email inputs

2009-03-01 Thread Stephan Veigl
Hi, you have the same error as above. Having a return statement in a for loop will evaluate the first element only. If you want to validate all emails that's a logical AND conjunction of all single email validations. So you have to have some and function in your code as well. Try something

[jQuery] Re: nested each - how to access parent's this??

2009-02-27 Thread Stephan Veigl
Hi, simply use a local variable: return this.each(function() { var parent = $(this); $(selector).each(function() { // do whatever you want with 'parent' }); }); by(e) Stephan 2009/2/26 mahakala mpy...@googlemail.com: Hi all, I'm new to jQuery and just got stuck on a

[jQuery] Re: Multiple JSON objects - using results from one JSON object within a $.each() parse of another JSON object

2009-02-27 Thread Stephan Veigl
Hi, first of all, AJAX is _asynchronous_, do you have any mechanism that ensures that the stations callback is executed _before_ the _dataloggers_ callback? (e.g. requesting datalogger once myStations has been filled) If you use myStations in both callbacks is should be a global variable. (I

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

2009-02-27 Thread Stephan Veigl
You could try something similar to $(#outerdiv).children().hide(explode); by(e) Stephan 2009/2/27 webspee...@gmail.com webspee...@gmail.com: Using the explode animation, where the div explodes into X pieces. On Feb 17, 8:30 pm, Ricardo Tomasi ricardob...@gmail.com wrote: What do you mean

[jQuery] Re: Hide/Show when Check Box is selected

2009-02-26 Thread Stephan Veigl
several checkboxes/hidden divs, but I only want to unhide the div that belongs to the clicked checkbox. Best regards. On Feb 18, 5:10 pm, Stephan Veigl stephan.ve...@gmail.com wrote: Hi Miguel, you can use the click trigger of the checkbox: form   show secret: input id=checkbox type

[jQuery] Re: Hide/Show when Check Box is selected

2009-02-26 Thread Stephan Veigl
it so when I click the checkbox for App #1 only the secret field for App #1 becomes visable. Thanks for your help! Best regards On Feb 26, 2:18 pm, Stephan Veigl stephan.ve...@gmail.com wrote: Hi the example is working on IDs (see the # in the selector). If you send a HTML snippet of your

[jQuery] Re: Clone Line and Increase Number by +1

2009-02-25 Thread Stephan Veigl
Hi Stephen, could you post some HTML snippets as well? What should $(this).val() be? Should the ID be dependent of the textarea input or should it simply be the row number? by(e) Stephan 2009/2/25 stephen skore...@gmail.com: Hello, I relatively new to Javascript in general, but I've been

[jQuery] Re: Change image attribute based on variable

2009-02-25 Thread Stephan Veigl
Hi, instead of doing a complicate string handling you could simply use window.location.hash: $finalurl = window.location.hash; For debugging I would do it step by step and not all in one line: var el = $($finalurl+ :first); var src = el.attr(src); var src_split = src.split(.); var new_src =

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

2009-02-24 Thread Stephan Veigl
Hi, I've done some profiling on this, and $(p, $(#foo)) is faster than $(#foo p) in both jQuery 1.2.6 and 1.3.2. the test HTML consists of 100 ps in a foo div and 900 ps in a bar div. However the factor differs dramatically: In 1.2.6 the speedup from $(p, $(#foo)) to $(#foo p) was between 1.5x

[jQuery] Re: Animate Delay Issue

2009-02-24 Thread Stephan Veigl
Hi Wolf, try to stop previous animations before adding a new one: $(this).stop().animate({...}); by(e) Stephan 2009/2/24 Wolf mscha...@gmail.com: I have a strange delay issue. I'm working on a menu animation.  When a user moves their mouse to the top, it will move the menu up and when

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

2009-02-24 Thread Stephan Veigl
...@gmail.com: I've been following this discussion, but I need explaining why $(p, $(#foo)) doesn't select all p tags and all #foo id's ? Stephan Veigl wrote: Hi, I've done some profiling on this, and $(p, $(#foo)) is faster than $(#foo p) in both jQuery 1.2.6 and 1.3.2. the test HTML consists

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

2009-02-24 Thread Stephan Veigl
Resource  -  http://jquery-howto.blogspot.com On Tue, Feb 24, 2009 at 6:44 PM, Liam Potter radioactiv...@gmail.com wrote: Hi Stehpan :p I understand that, I'm just not sure why $(p, $(#foo)) is not the same as $(p, #foo) - Liam Stephan Veigl wrote: Hi Lima, 1) #foo is an ID

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

2009-02-24 Thread Stephan Veigl
, Thanks for doing this testing! Would you mind profiling $('#foo').find('p') as well? I suspect it will be roughly equivalent to $('p', $('#foo')) Cheers, --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Feb 24, 2009, at 8:28 AM, Stephan Veigl wrote: Hi

[jQuery] Re: Input type radio events

2009-02-23 Thread Stephan Veigl
Hi Bruno, you need to define value attributes for your inputs fieldset pinput type=radio name=foo value=yes/yes/p pinput type=radio name=foo value=no/no/p filedset pinput type=checkbox name=value value=val1/ Value 1 /p pinput type=checkbox name=value value=val2/ Value 2 /p /fieldset input

[jQuery] Re: How to pass variables between jQuery plugins?

2009-02-21 Thread Stephan Veigl
something wrong. Thanks again in advance, Vic On Feb 20, 5:33 am, Stephan Veigl stephan.ve...@gmail.com wrote: Hi Vic, I guess the problem is that get is an asynchronous function. So anArray exists outside of your get-callback function (since you use it as global variable) but the value

[jQuery] Re: Stop effect

2009-02-20 Thread Stephan Veigl
Hi $(#y).stop().stop().stop() .show().css({opacity: 1.0}); by(e) Stephan 2009/2/20 adexcube alfonsoenci...@gmail.com: Hi, how can I stop this effect? $('#y').fadeOut('slow').animate({opacity: 1.0}, 3000).fadeIn('slow'); I've tried independently $('#y').stop();

[jQuery] Re: How to pass variables between jQuery plugins?

2009-02-20 Thread Stephan Veigl
Hi Vic, I guess the problem is that get is an asynchronous function. So anArray exists outside of your get-callback function (since you use it as global variable) but the value is not set when the get function returns since your callback has not been executed yet. So whenever you access anArray

[jQuery] Re: Selector Efficiency?

2009-02-19 Thread Stephan Veigl
Hi Josh, are your data ordered? (e.g. MAP_ID is the first li, SITE_ADDRESS the second, ...) If yes you can use a index based approach (from 4.8ms to 0.9ms on IE). var $foo = $(foo); var data = $foo.find(.atr-value); var parcelOutput = 'Parcel ID: ' + $(data[0]).text() + 'br' +

[jQuery] Re: jQuery validation question: validating multiple email inputs

2009-02-18 Thread Stephan Veigl
...@gmail.com: Yeah, I actually have that fixed in the posted link, but thanks for pointing that out. So, something else is at error now. On Feb 17, 9:04 am, Stephan Veigl stephan.ve...@gmail.com wrote: Hi is this just a copy paste error, or a real syntax error? You have to quote the comma

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

2009-02-18 Thread Stephan Veigl
Hi, how do you explode the outer div? Can you share your function with us? by(e) Stephan 2009/2/18 Ricardo Tomasi ricardob...@gmail.com: What do you mean by explode? remove? On Feb 17, 4:50 pm, webspee...@gmail.com webspee...@gmail.com wrote: Hey all. Exploding a simple div is easy

[jQuery] Re: Hide/Show when Check Box is selected

2009-02-18 Thread Stephan Veigl
Hi Miguel, you can use the click trigger of the checkbox: form show secret: input id=checkbox type=checkbox/ div id=div secret field: input type=text / /div /from $(#div).hide(); $(#checkbox).click(function(){ if ( this.checked ) { $(#div).show(); } else {

[jQuery] Re: jQuery validation question: validating multiple email inputs

2009-02-17 Thread Stephan Veigl
Hi is this just a copy paste error, or a real syntax error? You have to quote the comma in your split command: var emails = value.split(,); by(e) Stephan 2009/2/17 roryreiff roryre...@gmail.com: So far, I have adapted this: email: function(value, element) {

[jQuery] Re: Hover vs Click, etc.

2009-02-16 Thread Stephan Veigl
Hi, I would add a close button (or link) to your links div and add something like: closeBtn.click( function(){ $(this).parent().hide(); }); alternatively you can do: $(#menuReg).click( function(){ $(this).hide(); return true; }); Than your menu is closed whenever you click somewhere

[jQuery] Re: Hover vs Click, etc.

2009-02-16 Thread Stephan Veigl
\').show(); },function(){ $(#menuReg).click( function(){ $(this).hide(); return true; }); Thanks! * * * * * On Mon, Feb 16, 2009 at 1:41 AM, Stephan Veigl stephan.ve...@gmail.com wrote: Hi, I would add a close button (or link) to your links div and add something like

[jQuery] Re: Append images to div from JSON

2009-02-16 Thread Stephan Veigl
Hi Mark, there seems to be a problem with your json.php. Your output is encapsulated in round bracket and there is a single squared and curly bracket at the end of the output: ( {}{} ]}) your whole JSON output should be of the form: [{},{},...{}] by(e) Stephan 2009/2/16 mark

[jQuery] Re: How to find the biggest value?

2009-02-12 Thread Stephan Veigl
Hi David, var max = null; $(#box div).each(function() { if ( !max || max.height() $(this).height() ) max = $(this); }); // flash max div max.fadeOut().fadeIn(); by(e) Stephan 2009/2/12 David .Wu chan1...@gmail.com: for example, how to find biggest div height under box. div id=box

[jQuery] Re: Delayed Checkboxes in IE

2009-02-11 Thread Stephan Veigl
Hi Karl, you are right. I just tested it on IE, FF, Opera and Chrome. click works fine on all 4 browsers for both mouse and keyboard. by(e) Stephan 2009/2/10 Karl Swedberg k...@englishrules.com: On Feb 10, 2009, at 9:45 AM, Stephan Veigl wrote: change your $(input:checkbox).change

[jQuery] Re: Only show 5 list item, hide the rest?

2009-02-11 Thread Stephan Veigl
:01 pm, Stephan Veigl stephan.ve...@gmail.com wrote: Hi, try this one: var list = $('#myList li:gt(4)'); list.hide(); $('a#myList-toggle').click(function() { list.slideToggle(400); return false; }); by(e) Stephan 2009/2/10 mofle mofl...@gmail.com: Hi

[jQuery] Re: Only show 5 list item, hide the rest?

2009-02-11 Thread Stephan Veigl
...@gmail.com: Hi, thank you for all your help ;) How can I have the list splitted automatically? Because the list is for a log, and the newest items are on the top, and as new items are added, the old ones are pushed down, and hidden. On Feb 11, 10:31 am, Stephan Veigl stephan.ve

[jQuery] Re: $(element in other iframe)

2009-02-11 Thread Stephan Veigl
. So I can do this? var frame=$(#iframe)[0].contentdocument; $(frame).ready(function () { alert('Iframe has been loaded!'); }); Am I right? and Thank you again. On Feb 8, 6:07 pm, Stephan Veigl stephan.ve...@gmail.com wrote: Hi Ami you can access an iframe with: var frame

[jQuery] Re: catch-all clicks

2009-02-11 Thread Stephan Veigl
Hi, $().click( function() {...}); should work by(e) Stephan 2009/2/11 BrainBurner brainbur...@gmail.com: Hello, is there a way to catch-all click on the page? I tried $(html).click(fn), but it doesn't work..

[jQuery] Re: Jquery seems to be sending two requests the first few times. . .

2009-02-10 Thread Stephan Veigl
Hi Mark, ad 1) in Firebug I can see only one POST request. Do you have any content in your config.html which is loaded subsequently (e.g. images, js, ...)? Just try it with an empty config.html and without the callback function. ad 2) no Problem, you can chain AJAX request within the callback

[jQuery] Re: Numbering ... Could someone please help me out with this?

2009-02-10 Thread Stephan Veigl
+'].Description value = ' + description.val() + ' /'); }); On Feb 8, 8:13 am, Stephan Veigl stephan.ve...@gmail.com wrote: Hi Miguel, you could use a global counter. e.g. var themesCounter = 0; $('#AddTheme').bind('click', function(){ ... $theme.append

[jQuery] Re: Only show 5 list item, hide the rest?

2009-02-10 Thread Stephan Veigl
Hi, try this one: var list = $('#myList li:gt(4)'); list.hide(); $('a#myList-toggle').click(function() { list.slideToggle(400); return false; }); by(e) Stephan 2009/2/10 mofle mofl...@gmail.com: Hi. I have an unordered list like this one: ul id=myList

[jQuery] Re: Get DOM elements under click

2009-02-10 Thread Stephan Veigl
Hi Richard, you can bind one single event trigger to the document (or a parent element) and use the target property of the event. see: http://docs.jquery.com/Events/jQuery.Event e.g. $().click( function(ev) { $(ev.target).fadeOut().fadeIn(); }); by(e) Stephan 2009/2/10 Richard

[jQuery] Re: Problems...

2009-02-10 Thread Stephan Veigl
Hi, 1. How do you set up your first s,t,c? 2. Where does cod come from? 3. I suppose s and c should be strings. Then you would have to escape the strings in the onClick function call: a href='#' onClick='test(\+s+\, 0, \+c+\)'-/a by(e) Stephan 2009/2/10 Po01 diogoapa...@gmail.com: Hi,

[jQuery] Re: Delayed Checkboxes in IE

2009-02-10 Thread Stephan Veigl
Hi John, It looks like IE doesn't send a change event when the checkbox has been clicked, only after the element has lost focus. You can test this by adding a debug alert to your change function. change your $(input:checkbox).change(function () {... line to $(input:checkbox).bind(change

[jQuery] Re: How to pass a date to DatePicker??

2009-02-10 Thread Stephan Veigl
Hi André see: http://docs.jquery.com/UI/Datepicker - setDate by(e) Stephan 2009/2/10 AndreMiranda acymira...@gmail.com: Hi everyone!! How can I pass a date to DatePicker and it shows this date selected, highlighted etc? Thanks!! André

[jQuery] Re: what could be causing this isnull error ( realy weird )

2009-02-09 Thread Stephan Veigl
Hi, I got an error in line 267 because of the quote;s in the javascript function. Try to replace it with single quotes. input type=submit name=dnn$ctr579$Login$Login_DNN$cmdLogin value=Inloggen onclick=javascript:WebForm_DoPostBackWithOptions(new

[jQuery] Re: what could be causing this isnull error ( realy weird )

2009-02-09 Thread Stephan Veigl
, Stephan Veigl stephan.ve...@gmail.com wrote: Hi, I got an error in line 267 because of the quote;s in the javascript function. Try to replace it with single quotes. input type=submit name=dnn$ctr579$Login$Login_DNN$cmdLogin value=Inloggen onclick=javascript:WebForm_DoPostBackWithOptions(new

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

2009-02-09 Thread Stephan Veigl
()/ prev() on it. Adrian On Feb 4, 4:16 pm, Stephan Veigl stephan.ve...@gmail.com wrote: Hi, there are prev() and next() functions doing exactly what you need: $(div).each( function() { var prev = $(this).prev(); var next = $(this).next(); alert( prev.text

[jQuery] Re: alignment IN IE6 ... with jquery..

2009-02-09 Thread Stephan Veigl
couldn't see the screen shot you gave. I saw a error message in german or something. On Feb 6, 4:21 pm, Stephan Veigl stephan.ve...@gmail.com wrote: I've taken an additional look at your HTML CSS and it seems like you are positioning all your images absolute with left top position, so I don't

[jQuery] Re: please help me for the performance

2009-02-09 Thread Stephan Veigl
Hi David, use a reasonable speed e.g. 50ms = 20fps (instead of 1ms) should make the animation smoother and reduce computation time. you could also try to use background images instead of img, but that may be not suitable for your application. by(e) Stephan 2009/2/8 David .Wu

[jQuery] Re: Initialize tabs href.

2009-02-09 Thread Stephan Veigl
Hi Massimo, you forgot the closing parenthesis of the ready function $(document).ready(function() { initLinks(); }); // -- by(e) Stephan 2009/2/9 m.ugues m.ug...@gmail.com: Hallo all. I would like to initialize the tabs href on the document.ready. http://pastie.org/384170 I tried

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

2009-02-08 Thread Stephan Veigl
Hi I guess you have your $().ready() function in 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: Use a global variable in every html file to specify the init functions you want to call for

[jQuery] Re: $(element in other iframe)

2009-02-08 Thread Stephan Veigl
Hi Ami you can access an iframe with: var frame = window.frames[0].document; -or- var frame = $(#iframe)[0].contentDocument; var div = $(div, frame); just remember to wait until the iframe has been loaded. by(e) Stephan 2009/2/8 Ami aminad...@gmail.com: Can I use jQuery to work

[jQuery] Re: Numbering ... Could someone please help me out with this?

2009-02-08 Thread Stephan Veigl
Hi Miguel, you could use a global counter. e.g. var themesCounter = 0; $('#AddTheme').bind('click', function(){ ... $theme.append('input type=hidden name=Themes[themesCounter].Subject value = ' + $subject.val() + ' /'); ... themesCounter++; });

[jQuery] Re: Select element based on a value of its child element

2009-02-06 Thread Stephan Veigl
: Most likely... you should submit a ticket: http://dev.jquery.com/ Read jQuery HowTo Resource - http://jquery-howto.blogspot.com On Wed, Feb 4, 2009 at 9:24 PM, Stephan Veigl stephan.ve...@gmail.com wrote: Good point. I've just tested input[value=''] and got an error

[jQuery] Re: Optimize large DOM inserts

2009-02-06 Thread Stephan Veigl
Hi, thanks fort his little optimization tutorial :-) One question, is there a difference between a loop with a running variable (e.g. for (i=0; irows.length; i++) ) and a for-in loop (e.g. for (var i in rows) )? I've done some tests and couldn't find any performance difference beside the

[jQuery] Re: What is the best option to make this modal???

2009-02-06 Thread Stephan Veigl
Hi André, have you tried the jQuery UI Dialog widget? by(e) Stephan 2009/2/6 AndreMiranda acymira...@gmail.com: Hi everyone!! Can you guys tell me the best way to do this? I have a page which lists several tasks of a person. And when you roll over one task, a popup/modal/tip will appear

[jQuery] Re: how to wait for image finished loading then display the page?

2009-02-06 Thread Stephan Veigl
Hi Mark, I would suggest that you wait on the load event of your images. Something like: var imgTotal = 10; // total number of images on your page var imgCount = 0; $(img).load(function(){ imCount++; if (imgCount == imgTotal) $(#skip).show(); } There are plenty of discussions about

[jQuery] Re: alignment IN IE6 ... with jquery..

2009-02-06 Thread Stephan Veigl
or 6 and you will see what I am complaining about. hope this helps any. On Feb 5, 4:15 am, Stephan Veigl stephan.ve...@gmail.com wrote: Hi, can you post your code (e.g. at jsbin.com) or give us a link to it. Being standard compliant is always a good idea :-) by(e) Stephan 2009/2/5

[jQuery] Re: alignment IN IE6 ... with jquery..

2009-02-06 Thread Stephan Veigl
I've taken an additional look at your HTML CSS and it seems like you are positioning all your images absolute with left top position, so I don't see what should be different on IE. by(e) Stephan 2009/2/6 Stephan Veigl stephan.ve...@gmail.com: Hi I've tested the page and it looks similar

[jQuery] Re: All is well except in IE - links initially not clickable

2009-02-06 Thread Stephan Veigl
Hi, looks like you are running into racing-conditions. Why are you creating your list elements and bind the click event handler in two different and ASYNCHRONOUS functions initial_list() and site_details() ? Add you site_details() functionality to your initial_list() function just before the

[jQuery] Re: Optimize large DOM inserts

2009-02-06 Thread Stephan Veigl
Hi James, I run into a similar problem. Replacing parts of tables does not work with IE. (see http://de.selfhtml.org/javascript/objekte/all.htm#inner_html, sorry available in German only) Now I simply replacing the whole table which is still much faster than my previous version. by(e) Stephan

[jQuery] Re: alignment IN IE6 ... with jquery..

2009-02-05 Thread Stephan Veigl
Hi, can you post your code (e.g. at jsbin.com) or give us a link to it. Being standard compliant is always a good idea :-) by(e) Stephan 2009/2/5 shyhockey...@gmail.com shyhockey...@gmail.com: Hi, ok currently I just looked at my website using IE6 and IE7. I notice the pages I used

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

2009-02-05 Thread Stephan Veigl
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 = button {'.button'} == button1,...5 2. give me the element with index 1 = second element {:eq(1)} == button2 3. give me

[jQuery] Re: Deep $.extend() doesn't work with Date objects

2009-02-05 Thread Stephan Veigl
Hi, this is because jQuery creates anonymous objects for the clones and copies the object properties. For the Date object there are no public properties, so only the empty object hull is created. But you are right, not copying Dates correctly is a bit strange. If you disable the copy deep flag,

[jQuery] Re: $('#xxx').html() changing xhtml to html

2009-02-05 Thread Stephan Veigl
Hi, you could use RegExp to replace br with br/ and img .. with img ... /, but tis ir really just a workaround since you would need a single RegExp for every non closed tag in HTML. by(e) Stephan 2009/2/5 dantan hattin...@gmail.com: I am trying to parse the html out of a specific div to save

[jQuery] Re: Select element based on a value of its child element

2009-02-04 Thread Stephan Veigl
Hi, just a little remark: add a child selector '' before the 'input' or you will select surrounding divs as well. $(div:has(input[value='2'])) by(e) Stephan 2009/2/4 Mauricio (Maujor) Samy Silva css.mau...@gmail.com: $('div:has(input[value=2])') Maurício -Mensagem Original- De:

[jQuery] Re: animations; browser problem or bad code?

2009-02-04 Thread Stephan Veigl
Hi, I played around with your site and code a little bit (hope this was ok :-). What I discovered was that FF (and others) seems to have problems with setting (or animating) the width of an empty div via css. Adding a $('.main_content').html(nbsp;); before your open animation will do the

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

2009-02-04 Thread Stephan Veigl
Hi, there are prev() and next() functions doing exactly what you need: $(div).each( function() { var prev = $(this).prev(); var next = $(this).next(); alert( prev.text() + - + next.text() ); }); (I've skipped the extra code for the first and last element for simplicity.) by(e) Stephan

[jQuery] Re: Select element based on a value of its child element

2009-02-04 Thread Stephan Veigl
Adrian Lynch adely...@googlemail.com: Nice one! Should have spotted :has()... I've asked this in another thread but I'll slip it in here too, does the selector... input[value=''] ... work for any of you? Adrian On Feb 4, 12:11 pm, Stephan Veigl stephan.ve...@gmail.com wrote: Hi, just

[jQuery] Re: animations; browser problem or bad code?

2009-02-04 Thread Stephan Veigl
Hi, I took a short look on your code and noticed that you load your main content after the animation has finished. Is this really what you want to do? Shouldn't it be rather that the main content is loaded in background as soon as the link is clicked, and set to visible after the animation has

[jQuery] Re: Long List, no particular order of IDs

2009-02-04 Thread Stephan Veigl
Hi Drew, I'm not a JavsScript optimization expert, but here's my approach. Do you create the item list dynamically? If so, I would add every newly created jQuery object of an item into an array. Then loop through the array and expand / collapse as you like. If the HTML is created on server

[jQuery] Re: Posting a serialized string without Ajax ??

2009-02-04 Thread Stephan Veigl
Hi Brain, you can put it into a hidden input field and do a normal user submit of the form. by(e) Stephan 2009/2/4 sinkingfish sinkingf...@gmail.com: Hi, I think i might be overlooking the obvious but I've got a string from my sortable list, something like : item[]=3item[]=1... I

[jQuery] Re: events, lock and unlock

2009-02-03 Thread Stephan Veigl
Hi Cequiel, I've some questions to your problem. 1. Who triggers your events and when are they (supposed) to be dispatched? 2. If anotherevent happens before myevent it will have no effect on anotherobject. So what is anotherevent for? 3. What do you mean with lock/unlockEvent()? by(e) Stephan

[jQuery] Re: Problem with Chrome firing events correctly

2009-02-03 Thread Stephan Veigl
Hi Caleb, Could you please post your LiveSaver object and the element variable initialization as well. I tested your code with a more or less meaningful dummy implementation of LiveSaver and element and it works for me in: FF3, Chrome1, Opera9, IE8 I guess the problem is either in

[jQuery] Re: Help creating a function

2009-02-03 Thread Stephan Veigl
Hi Erwin, Of course you can code it by hand, but I would suggest that you take a look at the various validation plugins for jQuery (e.g. http://plugins.jquery.com/project/validate) first. by(e) Stephan 2009/2/3 ebru...@gmail.com ebru...@gmail.com: Hello, I have a site where i want to run

[jQuery] Re: Detecting wether an image link is going to work

2009-02-03 Thread Stephan Veigl
You can set a timeout and jump to the next image if the image was not loaded before the timeout. see: http://jsbin.com/evitu/edit The third image is a broken link and will run into a 5s timeout. by(e) Stephan 2009/2/3 daveJay davidjo...@exit42design.com: I've got a page set up where it

[jQuery] Re: Problem with Chrome firing events correctly

2009-02-03 Thread Stephan Veigl
()); LiveSaver.save(); }); } // Set LiveSaver_init to run after page has finished loading addOnloadHook(LiveSaver_init); // End code // On Feb 3, 3:04 am, Stephan Veigl stephan.ve...@gmail.com wrote: Hi Caleb, Could you please post your LiveSaver object and the element

[jQuery] Re: callback for append function?

2009-02-02 Thread Stephan Veigl
The append is done immediately, but you have to wait for the load event of the image before you can get the correct height. by(e) Stephan 2009/2/2 lhwpa...@googlemail.com lhwpa...@googlemail.com: is there any way to get a callback when append is ready? i have the following problem. i add

[jQuery] Re: callback for append function?

2009-02-02 Thread Stephan Veigl
You can make a function you call every time an image has been loaded and update a counter in this function. Once the counter reaches the number if images you have on your page, you know that all images where loaded. see: http://jsbin.com/ofici/edit by(e) Stephan 2009/2/2 Liam Potter

[jQuery] Re: Jquery Save Layout

2009-02-02 Thread Stephan Veigl
, Feb 2, 2009 at 4:48 PM, Chris Owen skatee...@gmail.com wrote: Hi Stephan I have tried this and when I click my button I get null. Guess I am calling the button incorrectly ? Many Thanks Chris. On Mon, Feb 2, 2009 at 4:23 PM, Stephan Veigl stephan.ve...@gmail.com wrote: Saving

[jQuery] Re: Dynamic url in ajax call based on select value

2009-02-02 Thread Stephan Veigl
First the bad news: After taking a look at cascade and playing around with the source code I think this is not possible with the original cascade plugin. The cascade plugin is copying the ajax options (including the url) at initialization time to local variable. So ajax: {url:

[jQuery] Re: How do I get the index of the currently clicked textbox?

2009-02-02 Thread Stephan Veigl
How about writing the index of the textbox into it's name attribute (or another attribute) and then get the index by var index = $(this).attr(name); by(e) Stephan 2009/2/2 bittermonkey brakes...@gmail.com: Hi, How do I get the index of the currently clicked textbox? I have 5 textboxes

[jQuery] Re: Building a weight calculator, completely stumped

2009-02-02 Thread Stephan Veigl
Simply use an each loop: $(#calculateweight).click(function() { var sum = 0; $(input[name*='weight']).each(function() { sum += Number($(this).val()); }); $(#totalweight).text( Math.ceil(sum) ); return false; }); @James: looks quite similar

[jQuery] Re: collapsible list

2009-02-02 Thread Stephan Veigl
Hi, that's a feature of the event bubbling in jQuery 1.3 You need to call stopPropagation(). $('li:not(:has(ul))').css({ cursor: 'default', 'list-style-image': 'none' }) .click(function(event) { event.stopPropagation(); return true;

[jQuery] Re: callback for append function?

2009-02-02 Thread Stephan Veigl
sure, no problem take a look at: http://jsbin.com/udeze/edit by(e) Stephan 2009/2/2 lhwpa...@googlemail.com lhwpa...@googlemail.com: ok thanks, and is there any way to use the load event to an image included with append?

[jQuery] Re: Jquery Save Layout

2009-02-02 Thread Stephan Veigl
Saving $(#root_element).html() to your DB should do the job. see a little demo: http://jsbin.com/uwujo/edit by(e) Stephan 2009/2/2 Chris Owen skatee...@gmail.com: Hey, I have been trying for about a week now to be able to save the layout of my page, I am using sortable, dragable etc so

[jQuery] Re: appendingTo a just created element

2009-01-31 Thread Stephan Veigl
the selector for an id is #, sou you should use #someID instead of someID for the appendTo() function. by(e) Stephan 2009/1/31 Nicky nha...@gmail.com: Hi All, I'm fairly new to jQuery so I apologize if I'm missing something straightforward but doing this: $('div/') .attr('id',

[jQuery] Re: $(this).ready with images

2009-01-31 Thread Stephan Veigl
Hi, the event you are looking fore is the image load event. try: $('.myimage').load(function(){...}); by(e) Stephan 2009/1/31 frederik.r...@gmail.com frederik.r...@gmail.com: Hi! I have the following task: I have a list of images and some of those images have a larger version that I

[jQuery] Re: jquery tabs ajax mode

2009-01-29 Thread Stephan Veigl
$(#tabs a).click(function() { $.get( $(this).attr(href), function(data) { $(#contaioner).html(data); }); return false; }); see also: http://docs.jquery.com/Ajax and (since I guess you are German speaking):

[jQuery] Re: copy input vals to 3 siblings in diffrent TR/TDs

2009-01-29 Thread Stephan Veigl
Your $(input.frage) within your each function would give you all questions for every each iteration. First you need to find the common root object of your current question (the row): var row = $(this).parent().parent(); Then you update all child inputs. Maybe you add a second, general

[jQuery] Re: .val is not a function

2009-01-29 Thread Stephan Veigl
And that's right, .val is NO function, the function is .val(). by(e) Stephan 2009/1/29 trancehead williamjhu...@gmail.com: All the core functions for JQuery seem to have stopped working. Jquery is the first script include so it appears before the other functions. script

[jQuery] Re: How to use one button to toggle multiple panels in succession

2009-01-29 Thread Stephan Veigl
do that? On Wed, Jan 28, 2009 at 7:39 AM, Stephan Veigl stephan.ve...@gmail.com wrote: I'm not sure if I realy understand what you want to do, but it could look something like HTML: div id=root div class=myHeaderbutton+/button/div div class='myPanel'1/div div class='myPanel'2

[jQuery] Re: Inside page jumps,

2009-01-29 Thread Stephan Veigl
to automatically jump to an anchor use the location hash: window.location.hash=there; by(e) Stephan 2009/1/29 pejot pjonar...@gmail.com: Hi, I have quite complex page with internal link inside. a href=#there id=jump Jump/a and a name=there /a far a way on bottom page. When I click

[jQuery] Re: eval(JSON_DATA) how safe is it?

2009-01-29 Thread Stephan Veigl
hi, check out the secureEvalJSON() method of the json plugin. http://code.google.com/p/jquery-json/ by(e) Stephan 2009/1/29 Trend-King i...@trend-king.de: Hi there another question from my, how save is it eval() data getting via JSON $.ajax() call i want to get javascript data to be

[jQuery] Re: eval(JSON_DATA) how safe is it?

2009-01-29 Thread Stephan Veigl
); getted from JSON? On 29 Jan., 14:51, Stephan Veigl stephan.ve...@gmail.com wrote: hi, check out the secureEvalJSON() method of the json plugin.http://code.google.com/p/jquery-json/ by(e) Stephan 2009/1/29 Trend-King i...@trend-king.de: Hi there another question from my, how

[jQuery] Re: How to decode Json value through Jquery

2009-01-28 Thread Stephan Veigl
If you use AJAX to get your data, take a look at: jQuery.getJSON() http://docs.jquery.com/Ajax/jQuery.getJSON If your JSON data came from another source, suppose your JSON data are stored in a string variable called json, you can simply do: eval(var obj=+json); then the variable obj will hold

[jQuery] Re: How to use one button to toggle multiple panels in succession

2009-01-28 Thread Stephan Veigl
I'm not sure if I realy understand what you want to do, but it could look something like HTML: div id=root div class=myHeaderbutton+/button/div div class='myPanel'1/div div class='myPanel'2/div div class='myPanel'3/div div class='myPanel'4/div div class='myPanel'5/div

[jQuery] Re: onblur Firing Ahead Of onclick

2009-01-28 Thread Stephan Veigl
Hi bob, So it works exactly how I would expect that it should work. 1. the focus is taken from the input, so you get a blur event 2. the submit button is clicked, so you get a submit event How about simply ignoring the blur event if you don't use it? If you use it for data validation you would

[jQuery] Re: HELP!!! wait for fade out before replacement div fades in

2009-01-28 Thread Stephan Veigl
simply do the fade in in the finished callback of the fade out $(a.linkclass).click(function() { var next = $($(this).attr(href)); $('.msg_body').fadeOut(fast, function(){ next.fadeIn(fast); }) }); by(e) Stephan

[jQuery] Re: UI Dialog Position Based on Link Position

2009-01-27 Thread Stephan Veigl
The position of the mouse is sent as parameter with the click event. see: http://docs.jquery.com/Tutorials:Mouse_Position If you want to position the dialog absolute to the link (and not the mouse pointer) you could use $(link).position to get the position of your link. see:

[jQuery] Re: Name Panels instead of calling them by #number

2009-01-26 Thread Stephan Veigl
What do you mean with panels? I'm not sure if it is what you are searching for, but if you have: div a name=contact... ... /div you can use $('a[name=contact]:parent') to get your surrounding div. However using an ID instead of the attribute search (name=...) will be much faster. by(e)

[jQuery] Re: Callback function not working

2009-01-25 Thread Stephan Veigl
haven't tested it, bu I guess the this variable is the problem in your callback $(#date_+$(this).attr(id)).html(Done!); try: var el = $(this); $.post(includes/updateleverans.php,{id:el.attr(id), date:date}, function (data) { $(#date_+el.attr(id)).html(Done!); }); by(e) Stephan

[jQuery] Re: strip tag leaving its content

2009-01-24 Thread Stephan Veigl
try: var wrap = $(#wrap); // your span or other wrapper element wrap.children().insertBefore(wrap); // insert children before wrapper element, insertAfter() inverses children order wrap.remove(); // remove wrapper element by(e) Stephan 2009/1/24 BrainBurner brainbur...@gmail.com: Hello,

[jQuery] Re: strip tag leaving its content

2009-01-24 Thread Stephan Veigl
This solution is easier one if the parent element has only one element - the span, if the parent element hase more spans (or other elements) parent.html() would overwrite all elements and replace them with the content of the child. The performace might also be an issue, however I have no idea

[jQuery] Re: bind eventhandler after animation finished

2009-01-24 Thread Stephan Veigl
First of all, slideUp(speed, callback) and slideDown(speed, callback) have callback functions which are called once the animation is finished. (see http://docs.jquery.com/Effects/slideDown#speedcallback - examples) But I'm not sure if this really solves your problem. If you bind the mouseleave

  1   2   >