[jQuery] Re: Selector Efficiency?

2009-03-02 Thread Stephan Veigl
case requires a .find('header') to work). > Second, my thanks for the very cool site link.  Definitely great for sample > snippets. > Thirdly, the sample speed measurement code - one reason for the question in > the first place was not knowing how to measure speed.  The sam

[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 like:

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

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 : > > Using the explode animation, where the div "explodes" into X pieces. > > On Feb 17, 8:30 pm, Ricardo Tomasi wrote: >> What do you mean by "explode"? remove? >> >> O

[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 kno

[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 : > > Hi all, > I'm new to jQuery and just got stuck on a problem where I'm having

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

2009-02-26 Thread Stephan Veigl
f="#">App #1Info >      [SECRET FIELD FOR App #1] >     class="tooltip" href="#">App #2Info >      [SECRET FIELD FOR App #2] >       . >   > > > I'd like to have it so when I click the checkbox for "App #1" only the >

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

2009-02-26 Thread Stephan Veigl
gt; I have 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 wrote: >> Hi Miguel, >> >> you can use the click trigg

[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_sr

[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 : > > Hello, I relatively new to Javascript in general, but I've been > attempting to use

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

2009-02-24 Thread Stephan Veigl
dberg : > Hi Stephan, > 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.engl

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

2009-02-24 Thread Stephan Veigl
-- >>>> Read jQuery HowTo Resource  -  http://jquery-howto.blogspot.com >>>> >>>> >>>> >>>> On Tue, Feb 24, 2009 at 6:44 PM, Liam Potter >>>> wrote: >>>> >>>> >>>>> >>&g

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

2009-02-24 Thread Stephan Veigl
am Potter : > > 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

[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 : > > 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 they move their

[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 s in a "foo" and 900 s in a "bar" . However the factor differs dramatically: In 1.2.6 the speedup from $("p", $("#foo")) to $("#foo p") was betwe

[jQuery] Re: Input type radio events

2009-02-23 Thread Stephan Veigl
Hi Bruno, you need to define value attributes for your inputs yes no Value 1 Value 2 than you can do the following $("input[name='foo']").click(function() { if ( $("input[name='foo']:checked").val() == "no" ) { $("input[name='value']").attr("checked",""); } }); by(e) Stephan

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

2009-02-21 Thread Stephan Veigl
e > callback function within $.get(). So I think I must be doing something > wrong. > > Thanks again in advance, > Vic > > On Feb 20, 5:33 am, Stephan Veigl wrote: >> Hi Vic, >> >> I guess the problem is that get is an asynchronous function. So >> anArray exists

[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 y

[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 : > > Hi, how can I stop this effect? > > $('#y').fadeOut('slow').animate({opacity: 1.0}, 3000).fadeIn('slow'); > > I've tried independently > > $('#y').stop(); > $('#y').stop(true); > $('#y').s

[jQuery] Re: Selector Efficiency?

2009-02-19 Thread Stephan Veigl
Hi Josh, are your data ordered? (e.g. MAP_ID is the first , 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() + '' +

[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: show secret: secret field: $("#div").hide(); $("#checkbox").click(function(){ if ( this.checked ) { $("#div").show(); } else { $("#div").hide(); } }) by(e) Stephan 2009/2/18 shapper : > > Hello, > > On a

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

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 : > > 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 nest

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

2009-02-18 Thread Stephan Veigl
9/2/17 roryreiff : > > 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 wrote: >> Hi >> >> is this just a copy & paste error, or a real syntax error?

[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 : > > So far, I have adapted this: > > email: function(value, element) { >return this.opti

[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 : > > I am try

[jQuery] Re: Hover vs Click, etc.

2009-02-16 Thread Stephan Veigl
27;t work. > > $(\'#triggerReg\').click(function(){ > > $(\'#menuReg\').show(); > },function(){ > > > $("#menuReg").click( function(){ > $(this).hide(); > return true; > }); > > Thanks! > > * * * * * > > On Mon, Feb 16,

[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 w

[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 : > > for example, how to find biggest div height under box. > > >. >

[jQuery] Re: catch-all clicks

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

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

2009-02-11 Thread Stephan Veigl
ed. > 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 wrote: >> Hi Ami >

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

2009-02-11 Thread Stephan Veigl
27;).prepend(""+txt+""); } by(e) Stephan 2009/2/11 mofle : > > 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,

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

2009-02-11 Thread Stephan Veigl
one problem though. > > I slides each individual li item, i need it to slide it like if i > would slide the whole list, but only the rest of the list that is > hidden? > > > > > > On Feb 10, 3:01 pm, Stephan Veigl wrote: >> Hi, >> >> try this one: &

[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 : > On Feb 10, 2009, at 9:45 AM, Stephan Veigl wrote: > > change your > $("input:checkbox&

[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 : > > Hi everyone!! > > How can I pass a date to DatePicker and it shows this date selected, > highlighted etc? > > Thanks!! > > André

[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("chang

[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: "-" by(e) Stephan 2009/2/10 Po01 : > > Hi, i have a function like this: > function test(s, t, c) > { > v

[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 : > > hello, >

[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 : > > Hi. > > I have an unordered list like this one: > > > Item 1 > Item 2 > Item 3 >

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

2009-02-10 Thread Stephan Veigl
7;).length; > $theme = $('').appendTo > ('#Themes'); > $theme.append(' value = "' + $subject.val() + '" />'); > $theme.append(''); > $theme.append(''); > }); > > > On Feb 8, 8:13 am, Ste

[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 as

[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 : > > Hallo all. > I would like to initialize the tabs href on the document.ready. > > http://pastie.org/384170 > > I tried like this > >

[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 , but that may be not suitable for your application. by(e) Stephan 2009/2/8 David .Wu : > > I think so, bu

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

2009-02-09 Thread Stephan Veigl
out. > > I 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 wrote: >> I've taken an additional look at your HTML & CSS and it seems like you >> are positioning all your images ab

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

2009-02-09 Thread Stephan Veigl
> > console.info($(this).next().html()); >> > console.info($(this).prev().html()); >> >> > }); >> >> > >> > >> > 1 >> > >> > This is next

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

2009-02-09 Thread Stephan Veigl
or i will look at it. All im interested in is why i get > the isnull errors because these just are not null they do excist and if they > dont excist that they should just be skipped. So there must be something > else generating the error and That I cannot find out > > On Mon, Feb 9,

[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 "e;s in the javascript function. Try to replace it with single quotes. by(e) Stephan 2009/2/9 Armand Datema : > HI > > Well it cant be more simple than this it just tries to get the element with > the class .grid-8 which is on the page for sure >

[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(''); ... themesCounter++; }); by(e) Stephan 2009/2/8 shapper : > > Hi, > > I am adding list items to a list as fo

[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 : > > Can I use jQuery to work with elements in

[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 thi

[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 2

[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 scr

[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 : > Hi > > I've tested the page and it

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

2009-02-06 Thread Stephan Veigl
> look at it with IE7 or 6 and you will see what I am complaining > about. > > hope this helps any. > > > > On Feb 5, 4:15 am, Stephan Veigl wrote: >> Hi, >> >> can you post your code (e.g. at jsbin.com) or give us a link to it. >> >> Being sta

[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: 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 : > > 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 and dynamically

[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; i: > > That is true > > I always suggest using built in for() loop with huge data sets... and > people keep ignoring me :))) > > > Read jQuery

[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 wrote: >> >> Good point. >> >> I've just tested "inpu

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

2009-02-05 Thread Stephan Veigl
Hi, you could use RegExp to replace with and with , 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 : > > I am trying to parse the html out of a specific div to save it with > php into a SQL-database. >

[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: 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. gi

[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 : > > Hi, ok currently I just looked at my website using IE6 and IE7. > > I notice the pages I used jquery and javascript,

[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 : > > > Hi, > > I think i might be overlooking the obvious but I've got a string from my > sortable list, something like : > item[]=3&item[]=1... > > I don't want to p

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

2009-02-04 Thread Stephan Veigl
in an error. Is this a bug? by(e) Stephan 2009/2/4 Adrian Lynch : > > 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

[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) Stepha

[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 : > > $('div:has(input[value=2])') > > Maurício > > -Mensagem Original- De: "Adrian Ly

[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(" "); before your open animation will do the trick.

[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 side,

[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 fi

[jQuery] Re: Problem with Chrome firing events correctly

2009-02-03 Thread Stephan Veigl
his.load = function() { >return unescape($.cookie(cookie_name)); >}; > }; > > function LiveSaver_init() { >LiveSaver.init(); > >LiveSaver.register(); > >$('#LiveSaverIcon').live('click', function(even

[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 : > > I've got a page set up where it loads each image on the page,

[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 : > > Hello, > > I have a site where i want to run a realtime ch

[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 LiveSaver.add(

[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: 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: 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 simi

[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 : > > Hi, > > How do I get the index of the currently clicked textbox? I have 5 > textboxes in a form, all

[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: $("select#chained")

[jQuery] Re: Jquery Save Layout

2009-02-02 Thread Stephan Veigl
t to my database? > > Many Thanks > > Chris. > > On Mon, Feb 2, 2009 at 4:48 PM, Chris Owen wrote: >> >> Hi Stephan >> >> I have tried this and when I click my button I get null. >> >> Guess I am calling the button incorrectly ? >> &g

[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 : > > can

[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 : > 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 that my users ca

[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 : > > ok thanks, and is there any way to use the load event to an image > included with append?

[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 : > > is there any way to get a callback when append is ready? > > i have the following problem. i add some images with .app

[jQuery] Re: appendingTo a just created element

2009-01-31 Thread Stephan Veigl
$('') >.attr('id', 'ntww-'+serial) >.insertBefore(elm); >$('') >.appendTo('#ntww-'+serial); > > Sorry about that and thanks for the reply! > > -Nicky > > On Jan 31, 9

[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 : > > Hi! > > I have the following task: I have a list of images and some of those > images have a larger version that I want to display in

[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 : > > Hi All, > > I'm fairly new to jQuery so I apologize if I'm missing something > straightforward but doing this: > > $('') >.attr('id', 'someID')

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

2009-01-29 Thread Stephan Veigl
info").fadeIn >> > (500);setTimeout(function(){$("#cart_info").fadeOut(500)},2000); >> > getted from JSON? >> >> > On 29 Jan., 14:51, Stephan Veigl wrote: >> >> hi, >> >> >> check out the secureEvalJSON() method of the jso

[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 : > > 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 executed after JSO

[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 : > > Hi, > > I have quite complex page with internal link inside. > < a href="#there" id="jump"> Jump and far > a way on bottom page. > > When I click a link Jump page jum

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

2009-01-29 Thread Stephan Veigl
e) Stephan 2009/1/29 Kevin Rodenhofer : > Not bad at all...if I "remove" them with slideUp, in succession, how would I > do that? > > On Wed, Jan 28, 2009 at 7:39 AM, Stephan Veigl > wrote: >> >> I'm not sure if I realy understand what you

[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 : > > All the core functions for JQuery seem to have stopped working. > > Jquery is the first script include so it appears before the other > functions. > >

[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, gener

[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): http://www.ajax-community.de/javascript/5951-jquery-ajax-ergebnis-ins-dom

[jQuery] Re: if condition within a loop

2009-01-29 Thread Stephan Veigl
First of all, you have a typo in your css for #portMain (line 5), the color value should have exactly 6 (or 3) hexadecimal digits 1. (line 35) you are using a jQuery each() function so the this object is the selected object and not the this object you expected it to be 2. (line 39): if($('#portM

[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 w

[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: 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: + 1 2 3 4 5 JavaScript: var myPanels = $(".myPanel").hide(); var nextPanel = 0; $(".myHeader button").click(function(){ if (nextPanel < myPanels.length) { $(

[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: 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: http://docs.jquery.co

[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: ... ... 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) Stephan 2009/1/

[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!"); }

[jQuery] Re: Weird Hiding Issue

2009-01-24 Thread Stephan Veigl
suppose you have a jQuery element called: div div.children(":not(:first)").hide(); will hide every immediate child of the div, except the first one by(e) Stephan 2009/1/24 david.vansc...@gmail.com : > > Yeah, I figured it was probably something along those lines. So what > would be t

  1   2   >