[jQuery] Re: Refresh SPAN without entire page
Why asking this question ? you know , For example , there is a three links one,two,three, When one is clicked around 50 rows data will be displayed , there user can delete the required row, assume if i give the page refresh , then user have to click the link again , Assume if is there any function do somthing link refresh span , means , That span contained rows will refresh , then will will not affect , thats y am asking ,,, thanks in advance On Fri, May 22, 2009 at 12:30 AM, Liam Byrne wrote: > > What do you mean "refresh span" ? > > You can reset the content of a particular SPAN using > $(spanReference).html("NEW CONTENT") or $(spanReference).text("NEW CONTENT") > > But unless you've changed the content of the SPAN (using one of the above, > in which case you already know it), what's there to refresh ? > > L > > bharani kumar wrote: >> >> Hi All, >> >> How to Refresh SPAN without page refresh , >> >> Can you tell name of the jquery function , >> >> -- >> ?? ?? >> ?? >> >> Regards >> B.S.Bharanikumar >> >> POST YOUR OPINION >> http://bharanikumariyerphp.site88.net/bharanikumar/ >> >> >> >> No virus found in this incoming message. >> Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: >> 270.12.35/2124 - Release Date: 05/20/09 06:22:00 >> >> > > -- உங்கள் நண்பன் பரணி குமார் Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/
[jQuery] tablesorter plugin help -- getting it to ignore quotation marks
I'm using the tablesorter plugin, and have run into a small issue I can't figure out how to solve: One of the columns in my table contains titles, some of which are books, others of which are articles or television episodes. The latter two start with a double quote (“)... So, for example, one cell in the column might be: Title of Book while another would be: “Title of Article” Tablesorter seems to be factoring these starting double quotes into the sort order for that column, so I end up with a list that is titles without quotes alphabetically first, and then titles with quotes alphabetically second. Is there any way I can get it to ignore the double quote, so that sorting on the column always goes by the first actual letter of the text? Thanks a bunch for any help.
[jQuery] Rollover Effects instead of alternate images
Hi, Just wondering if there's some effect in JQ that we can use to simulate rollover. Usually when user hovers a mouse over a link/image it changes its src/ background to another one (for example arrow.png -> arrow_o.png). So users feels like it is highlighted or similar. But we always must have 2 images (similar ones). Maybe there's some effect that can simulate this highligting/hover for user so we don't need to have 2 images. I understand it will never be as good as alternative image, but still. Thanks, Dmitriy.
[jQuery] Easing seems not work in 1.3.2 animate
I try to integrate easing with 1.3.2 animate but seems its just not working. Which version of the easing plugin I should use?
[jQuery] Re: cycle plugin with keyboard
the all the arrow has charcode of "0" (zero). I know this by the code var key = e.which; alert(key); So how the script which is right arrow which is left arrow. On May 21, 10:51 pm, "ryan.j" wrote: > yeah, stick this in document ready. > > to simulate the click, get the id of element you'd normally click to > advance the scroller (inspect it with the mozilla plugin firebug) and > append .click() > > On May 21, 4:45 pm, runrunforest wrote: > > > could you give some further tip, how can I simulate, where should I > > put the code to (document.ready part ?). > > > On May 21, 10:28 pm, "ryan.j" wrote: > > > > $(window).keypress(function (e) { > > > if (e.which == 39 ) { > > > /* keypress right */ > > > } elseif (e.which == 37 ) { > > > /* keypress left */ > > > } else { > > > return false; > > > } > > > > }); > > > > if you can't figure out how to advance the cycle on your own, maybe > > > try to simulate $('#scrollLeft').click() > > > > On May 21, 2:48 am, runrunforest wrote: > > > > > In cycle plugin, ss there way to switch images by keyboard arrows > > > > instead of clicking "next, prev"
[jQuery] Re: Cluetip from a function?
Yeah I have tried and it doesn't work :-( When I tried it nothing happens, is there any chance this can be supported? Regards DotnetShadow On May 21, 3:24 pm, Karl Swedberg wrote: > I don't think so. Have you given it a try? Seems like a smart idea. > > --Karl > > > Karl Swedbergwww.englishrules.comwww.learningjquery.com > > On May 12, 2009, at 5:55 AM, DotnetShadow wrote: > > > > > Hi there, > > > Is it possible to load cluetip from a function, such as: > > > > > function showtooltip(item){ > > $(item).cluetip( > > { > > > }); > > } > > > > > The reason I ask is that sometimes you don't want to bind to all > > elements if a user will only select 1 or 2 items, sometimes the > > cluetip might not even get activated at all so it seems a waste of > > resources binding cluetip on document.ready > > > Regards DotnetShadow
[jQuery] Reorder list items?
How can I re order items in a list... kinda like what happends on: http://www.viget.com/work
[jQuery] Re: how to get the element that triggered the event
Instead of declaring the javascript handler in the href, declare it with jQuery in a script section. Print $("a.print").click(function() { printSection( $(this).parent() ); return false; }) _jason On May 21, 7:18 pm, iceangel89 wrote: > i have a link that onclick calls function printSection > > Print > > i want to find out which link isit so i can get the parent, and do > whatever i need to
[jQuery] Re: What happen with jQuery? Is it slow?
It has apparently sped up 50% with the latest release. The time it takes to perform any of those test cases is not important to me. What is important is the application's perceived speed. I find jQuery to perform quite satisfactorily in that context. In fact, the real world involves great expanses of idleness sporadically interrupted by meaningful work. A few milliseconds here and there don't really matter 99% of the time. Besides, jQuery's greatest strength is the clean and elegant coding model. I don't think anyone will say speed was the objective of jQuery - other than speed of learning/designing/coding with the framework. On May 21, 9:57 pm, Alexsandro_xpt wrote: > Make this testhttp://dante.dojotoolkit.org/taskspeed/
[jQuery] how to get the element that triggered the event
i have a link that onclick calls function printSection Print i want to find out which link isit so i can get the parent, and do whatever i need to
[jQuery] Re: submit() not submitting
That will only submit if form is the first-child of it's parent (in the DOM). Can you verify that's the case? alert( $("form:first").length ); // or something On May 21, 12:51 pm, l3kris wrote: > I have this function that validates and is supposed to submit a simple > form: > > $(function() { > $('#godkend').click(function() { > if($('#Select1').val() == "") { > alert('Du har ikke valgt første'); > } else if($('#Select2').val() == "" && $('#Select2').is(':visible')) > { > alert('Du har ikke valgt anden'); > } else if($('#Select3').val() == "" && $('#Select3').is(':visible')) > { > alert('Du har ikke valgt tredje'); > } else { > alert('fint'); > $("form:first").submit(); > } > > }); > }); > > The validation works fine, but the submitting doesn't. The test (alert > ('fint')) pops up allright, so what should I change?
[jQuery] What happen with jQuery? Is it slow?
Make this test http://dante.dojotoolkit.org/taskspeed/
[jQuery] attribute selector order
(Firefox 3.0.10, OS X) Can anyone explain why these two statements would return different sets? >>> inlineTips.filter("[title!=''][value='']") [input.inlinetip, input.inlinetip, input.inlinetip, input.inlinetip, input.inlinetip] >>> inlineTips.filter("[value=''][title!='']") [] To make sure it's not just ignoring the second attribute... >>> inlineTips.filter("[value='']") [input.inlinetip, input.inlinetip, input.inlinetip, input.inlinetip, input.inlinetip] >>> inlineTips.filter("[title!='']") [input.inlinetip, input.inlinetip, input.inlinetip, input.inlinetip, input.inlinetip] Does attribute order really matter? Am I just having a massive brain fart?
[jQuery] Re: animate padding start value - Firefox (getComputedStyle)
The problem occurs when trying to determine the 'start' value. getComputedStyle explodes 'padding' into its four individual components. If you want to animate padding (or margin), you either have to specify each one in the first argument, or explicitly set the initial padding on the element (as opposed to via a stylesheet). On May 21, 12:16 pm, Liam Byrne wrote: > Maybe I'm wrong, but I think > > myElement.animate( {padding: 12px} ) > > won't work anyway ? Shouldn't it be > > myElement.animate( {padding: 12} ) > > That said, tests here show that only IE & Opera offer a smooth animation > - the others (FF, Chrome & Safari) seem to jump > > L > > Jason Persampieri wrote: > > (Firefox 3.0.10, OS X) > > > I am setting a padding value via a stylesheet and trying to animate it > > - > > > - CSS > > myElement { padding: 20px } > > > - Javascript > > myElement.animate( {padding: 12px} ) > > > When calculating the start padding value, jQuery calls > > 'getComputedStyle'. Unfortunately, > > > computedStyle.padding = "" > > computedStyle.padding-top = "20px" > > computedStyle.padding-right = "20px" > > computedStyle.padding-bottom = "20px" > > computedStyle.padding-left = "20px" > > > and the call to 'getPropertyValue' returns an empty string (which is > > translated to 0px). > > > Would this be considered a jQuery or Firefox issue? > > > > > No virus found in this incoming message. > > Checked by AVG -www.avg.com > > Version: 8.5.339 / Virus Database: 270.12.36/2126 - Release Date: 05/21/09 > > 06:22:00
[jQuery] Re: $.get() fetch a list of images
Ajax is asynchronous. When var total = splitted.length is executed the response might not have been returned yet. Put everything from "var slide(...)" on inside the callback, or in a function call. On May 21, 4:18 pm, Fabdrol wrote: > Hi all! > > I'm facing a problem, and it seems very unlogical that it doesn't > work. > I've written a function to switch some images on a clients website. It > takes images from an array, and displays them with some nice fades. > > Now I'm trying to fetch these images using AJAX, initially from a text > file, later I'll fetch them from a php script which fetches them from > a database. The script outputs like this: > > image1.png,image2.png,image3.jpg,image4.jpg,image5.png > > in the script I use the following to split it into an array: > > > > var splitted; > var path = 'uploads/slideshow/'; > > $.get('ajax.txt', function(data) { > splitted = data.split(','); > console.log(splitted); // outputs to firebug to check if GET > worked > > }); > > var slide = $(elm).attr('slide'); > var total = splitted.length; > var next = slide+1 > var picture = splitted[next]; > > $(elm).fadeOut(1000, function() { > $(elm).attr('slide', next).css('background', 'url('+path+picture > +')'); > $(elm).fadeIn(1000); > > }); > > > > but somehow, the $.get() part outputs nicely to the console, but after > that console gives an error that total splitted.length cannot be > determined because splitted is undefined! quite strange isn't it? > > I tried to remove the console.log(), tried to define the img array > before $.get() and populate it inside the $.get(). > Nothing works! What should I do, and more important, why does it > behave like this? > > thanks, > > Fabian
[jQuery] Re: $.get() fetch a list of images
The problem is that while this section of your code is waiting for the ajax response: > $.get('ajax.txt', function(data) { > splitted = data.split(','); > }); This section is already running... > var slide = $(elm).attr('slide'); > var total = splitted.length; > var next = slide+1 > var picture = splitted[next]; Something like this should work: $(document).ready(function(){ $.get('ajax.txt',function(received) { if(received.indexOf(',') >= 0) { var images = received.split(','); var total = images.length; console.debug('Length: '+total); /* var slide = $(elm).attr('slide'); // without markup, we'll just assume this value = 1 */ var slide = 1; console.log('Slide: '+slide); var next = parseInt(slide)+1; console.log('Next: '+next); if(images[next] !== 'undefined') { var picture = images[next]; console.log('Picture: '+picture); runAnimation(elm,next,picture) } } } function runAnimation(elm,next,picture) { $(elm).fadeOut(1000, function() { $(elm).attr('slide', next).css('background', 'url('+path+picture +')'); $(elm).fadeIn (1000); }); } });
[jQuery] Re: $.get() fetch a list of images
Without the markup it's hard to provide a complete solution, but if I run this it works for me: $(document).ready(function(){ // Start with faked $.get() results [since that part works] var received = 'image1.png,image2.png,image3.png'; console.log('Received: '+received); if(received.indexOf(',') >= 0) { var images = received.split(','); var total = images.length; console.debug('Length: '+total); /* var slide = $(elm).attr('slide'); // without markup, we'll just assume this value = 1 */ var slide = 1; console.log('Slide: '+slide); var next = parseInt(slide)+1; console.log('Next: '+next); if(images[next] !== 'undefined') { var picture = images[next]; console.log('Picture: '+picture); } else { console.log('Next Position is not Valid - end of array'); } } else { console.log('Missing commas'); } });
[jQuery] Re: Begginner Problems......
Hi I am not too sure what your doesnt work means. But for a couple of things First, I dont think number for id is valid try make your id="id1" instead of id="1" Second try $().attr("checked", "checked") and $().attr("checked", "") or $().removeAttr("checked") and see if you get anything
[jQuery] Re: selecting multiple selects
$("select.sortby").change(function() { window.location = "http://..."; + "&order=" + $(this).val(); }); On May 21, 7:10 pm, dezok714 wrote: > I am writing a sortby function that uses two "select"s on the page and > digs out the option val and submits the page for a new view. You can > see the sortby on this page: > > http://www.beachhouse.com/vacation/search.asp?Country=United+States&S... > > at the top and bottom. I figured I could set a class for both the > selects as class="sortby", and do singel $(.sortby).change(function() > BUT that did not seem to work so I created two unique ids for the > selects, id="sortBy1" and id="sortBy2". Which works. > > Just wondering if I could optimize and collape these: > > > > $('#sortBy1').change(function(){ > var str = ""; > > str = "&order=" + $("#sortBy1 option:selected").val(); > > window.location = "http://www.beachhouse.com/vacation/search6.asp? > s=1" + str; > > }); > $('#sortBy2').change(function(){ > var str = ""; > > str = "&order=" + $("#sortBy2 option:selected").val(); > > window.location = "http://www.beachhouse.com/vacation/search6.asp? > s=1" + str; > > }); > > > > ... > ...
[jQuery] Re: removing focus from field
it's ".blur()" if it doesn't work for you, then you are not using it properly posting your code would be a big help for others to help you On May 21, 8:08 pm, macsig wrote: > Hi all, > I'm submitting a form when the value of a drop-down menu changes. > After that I would like to remove the focus from the field itself. I > have tried different things: blur, focus=remove and so on but no one > works. > > How can I remove the focus for a field? > > Thanks and have a nice day! > > Sig
[jQuery] How to tell if $(window).load() has already fired
I have a script that is being inserted dynamically via another script. The code in that script is wrapped inside the $(window).load () event because it requires the images on the page to have all loaded. In some browsers it works fine, but in others it seems not to fire because the page has already finished loading by the time the code is run. Is there any way to check and see if the page has already finished loading? Since it is a dynamically inserted script I don't have access to the onload event of the original document (aside from altering it via the loaded script - but that would seem to present the same problem). Any ideas/solutions/advice would be greatly appreciated!
[jQuery] Superfish - align to bottom of div
Hi, I have a div and I would like to align super fish menu to sit at the bottom of it. Doing it this way, superfish ul seems to have a margin-bottom of 16px and I can't seem to get rid of it. I'm open to suggestions or doing it a completely different way. Thanks! HTML: Tuners Amps Wires STYLE: #header { background-image: url('menu_files/bannerbg.jpg'); background-repeat: no-repeat; height: 106px; position: relative; } #header ul { position: absolute; bottom: 0px; }
[jQuery] Re: Using a selector recursively
It works fine for me. Does your actual script block contain a $(document).ready(function(){ ... }); ? On Thu, May 21, 2009 at 16:49, sean wrote: > > I forgot the '#' sign in the sample code I provided. > > The problem I am having is that the code does not work. For some > reason, If i remove the tags, it works, but keeping them in > makes it not work.
[jQuery] removing focus from field
Hi all, I'm submitting a form when the value of a drop-down menu changes. After that I would like to remove the focus from the field itself. I have tried different things: blur, focus=remove and so on but no one works. How can I remove the focus for a field? Thanks and have a nice day! Sig
[jQuery] Re: Using a selector recursively
I forgot the '#' sign in the sample code I provided. The problem I am having is that the code does not work. For some reason, If i remove the tags, it works, but keeping them in makes it not work.
[jQuery] Re: jQuery Cycle plugin (help show/hide slide shows on same page)?
Ok, I think I've got it. I am now setting up the second slide show at the click event and then showing it immediately following. Like this: [code]jQuery('#buttons [href]').click( function(){ var element = jQuery(this); var href=element.attr("href"); jQuery('#screed').html($(href).html()); arrowFadr(); if (href == "#about"){ //$('#s1,#s2').hide(); $('#s3').cycle({ fx: 'all', timeout: 1, easing: 'easeOutExpo', delay: -2000, next: '#s3', pause: 1, speed: 1000 }); $('#s4').cycle({ fx: 'blindX,fadeZoom,scrollLeft,scrollHorz,slideX,toss,turnLeft', timeout: 1, easing: 'easeOutExpo', pause: 1, speed: 1000 }); jQuery('#s3').show(); jQuery('#s4').show(); }; });[/code] you can see the live example @ the link I posted above. But, This brings up another issue. the overlaying cycle slide shows work with Web-kit browsers but no others? what am I doing wrong? jQuery should be compatible with the slew. Can you see any reason why it displays for a few slides and then vanishes (never to be seen again)? Thanks again for any help.
[jQuery] Re: jQuery, MooTools, and Prototype - A Comparison
http://blog.creonfx.com/examples/javascript/speed-compersion-raw-data-revised.html http://blog.creonfx.com/javascript/mootools-vs-jquery-vs-prototype-vs-yui-vs-dojo-comparison-revised att. (ツ) Jackson F. de A. Mafra Designer,Desenvolvedor e Consultor http://www.jacksonfdam.com.br Esta mensagem, incluindo seus anexos, pode conter informações confidenciais e/ou privilegiadas. Se você não for a pessoa autorizada a receber esta mensagem, não pode usar, copiar ou divulgar as informações nela contidas ou tomar qualquer ação baseada nessas informações. Caso esta mensagem tenha sido recebida por engano, por favor avise imediatamente o remetente, respondendo o e-mail e em seguida elimine-a do seu sistema. Agradeço sua cooperação. On Thu, May 21, 2009 at 5:00 PM, Matt Kruse wrote: > > All 3 frameworks have pros and cons. They have many technical > similarities and each come with their own set of problems. If you can > avoid using a framework, always do that. But if the pros of using a > framework outweigh the cons, I think the decision mostly comes down to > popularity. > > Choose the framework that will have the most documentation, the > biggest user community, will be around the longest, will have the most > number of developers familiar with it, and can be seen as gaining in > popularity rather than declining. > > If you look at Google Trends to compare the three: > > > http://www.google.com/trends?q=jquery+javascript%2Cmootools+javascript%2Cprototype+javascript > > you'll see that MooTools and Prototype are steady or declining, while > jQuery has a dominant lead in popularity and is increasing rapidly. > Granted, this is only an analysis of searches, but it's a fair picture > of relative popularity of the different frameworks. There is always > some safety in choosing the "market leader" and if you are going in > blind with no desire to do an in-depth analysis of each option, then > choosing jQuery would probably be your safest best. > > IMO, > > Matt Kruse > > > On May 21, 2:05 pm, kiusau wrote: > > After a badly needed pause of some length, my need for sophisticated > > JavaScript has reemerged. During my departure I have discovered two > > other similar JavaScript modules called MooTools and Prototype. With > > my reemergence I have also realized that all of these require a > > certain amount of commitment that goes beyond what I initially > > anticipated. What I would like from you all is a convincing argument > > to remain that is based on the following comparison: > > > > 1) What are the principal advantages of jQuery over Prototype and > > MooTools? > > 2) What are the principal disadvantages of jQuery when compared with > > Protoype and MooTools? > > > > Roddy >
[jQuery] submit() not submitting
I have this function that validates and is supposed to submit a simple form: $(function() { $('#godkend').click(function() { if($('#Select1').val() == "") { alert('Du har ikke valgt første'); } else if($('#Select2').val() == "" && $('#Select2').is(':visible')) { alert('Du har ikke valgt anden'); } else if($('#Select3').val() == "" && $('#Select3').is(':visible')) { alert('Du har ikke valgt tredje'); } else { alert('fint'); $("form:first").submit(); } }); }); The validation works fine, but the submitting doesn't. The test (alert ('fint')) pops up allright, so what should I change?
[jQuery] selecting multiple selects
I am writing a sortby function that uses two "select"s on the page and digs out the option val and submits the page for a new view. You can see the sortby on this page: http://www.beachhouse.com/vacation/search.asp?Country=United+States&State=California&City=Newport+Beach at the top and bottom. I figured I could set a class for both the selects as class="sortby", and do singel $(.sortby).change(function() BUT that did not seem to work so I created two unique ids for the selects, id="sortBy1" and id="sortBy2". Which works. Just wondering if I could optimize and collape these: $('#sortBy1').change(function(){ var str = ""; str = "&order=" + $("#sortBy1 option:selected").val(); window.location = "http://www.beachhouse.com/vacation/search6.asp? s=1" + str; }); $('#sortBy2').change(function(){ var str = ""; str = "&order=" + $("#sortBy2 option:selected").val(); window.location = "http://www.beachhouse.com/vacation/search6.asp? s=1" + str; }); ... ...
[jQuery] Re: jQuery, MooTools, and Prototype - A Comparison
What do you want to use the library for? Selecting DOM Elements DOM Manipulation Simplifying Events Simplifying Ajax Mimicking classical inheritance Extending native objects with 'missing' capabilities Cool Widgets >From what I can tell, these are the main areas of focus of all the major javascript libraries. jQuery excels at Selecting DOM elements, DOM manipulation, Simplifying events, and simplifying ajax. It has decent classical inheritance support via plugins. It has a few javascript object/array enhancement capabilities but does not add them to the native objects. jQuery UI has many cool widgets. If you really want missing javascript object/array methods then Prototype is a good option, but jQuery is as good or better at everything else. Prototype also has Class support in its core and some neat effects in Scriptaculous. If you want a full blown classical inheritance coding strategy, mootools excels at this. It also provides a ton of missing object/ array methods, but it more wordy then jQuery and doesn't provide the shortcuts that jQuery does by default. Mootools prides itself on its extendability and can be extended to provide these shortcuts if you want. I've taken part in all of the communities surrounding these three libraries, and jQuery has by far the most friendly and helpful community. Check out the number of members on this list vs. the Prototype/Scriptaculous list. Prototype developers are a silent lot, popping up now and again to say something, but for the most part are quiet. John Resig, the creator of jQuery, is usually quite active on the boards but I suspect has gone into a bit of seclusion lately to finish up his next book. Mootools community is the least helpful, and is sometimes outright hostile. The mootools library developers are all very quiet and don't come out into the spotlight often, but Aaron Newton has taken up being the public face of mootools. He recently wrote an article on jQuery vs Mootools with a somewhat mootoolish bias, but its a great article: http://jqueryvsmootools.com/ On May 21, 12:39 pm, kiusau wrote: > On May 21, 12:23 pm, David Meiser wrote: > > > If you can't bear that thought, just *choose* one. None of my friends were > > using jQuery when I started using it (now I've converted all of them), but I > > read an article saying that it was going to be included in ASP.NET MVC and > > VS 2010. So, I gave it a shot, liked it, so I continue using it. > > I am not sure that it makes a difference, but I am a dedicated Mac > user. > > One other important issue that I forgot to mention is that for the > moment I have no server-side capability, but will eventually move away > from my client-side only constraint. > > Roddy
[jQuery] Opacity and IE
Not sure if this is a bug or me. I have a div that contains an image. The div has position relative and the image within it has position absolute. The image is wider than the div and I want the image to display outside the div. So far, everything works fine, however if I change the opacity of the div, any part of the image that falls outside it disappears in IE only. If I remove the code that changes the div's opacity, it shows up fine in IE. Is there a bug in jquery/IE that would cause this or am I doing something wrong? In case you're wondering what I'm doing, I'm trying to make an image inside of the div be its drag handle.
[jQuery] Re: Plugin Best practices?
animal!! 2009/5/21 aquaone > http://developer.yahoo.com/performance/rules.html > > ^^ highly recommended reading. > > aquaone > > > > On Thu, May 21, 2009 at 13:10, Donkeybob wrote: > >> >> I use three or four jquery plugins for a site. What's the best >> practice in loading all of these files and how much does it slow down >> an app? Do you reference them from another file to keep the page code >> clean? Just a couple of questions to find out about . . . . >> >> Thanks, >> Rich > > > -- Atenciosamente, Rodrigo Matheus
[jQuery] Re: Plugin Best practices?
http://developer.yahoo.com/performance/rules.html ^^ highly recommended reading. aquaone On Thu, May 21, 2009 at 13:10, Donkeybob wrote: > > I use three or four jquery plugins for a site. What's the best > practice in loading all of these files and how much does it slow down > an app? Do you reference them from another file to keep the page code > clean? Just a couple of questions to find out about . . . . > > Thanks, > Rich
[jQuery] Re: Using a selector recursively
That works, yes, but it would create a new jQuery object, defeating much of the purpose of him creating 'obj' in the first place (memory and processing time of creating new jQuery object). As an aside, many devs find it useful to prefix vars for jQuery objects with $. e.g. var $obj = $("#test"); aquaone On Thu, May 21, 2009 at 11:26, waseem sabjee wrote: > There was no need to use find() > $(function() { > }); > would be required from jquery > > (".myclass", obj) is select my class from within my object ( no need to use > .find() ) > > > $(function() { // you need this > var obj = ("#test"); // object refference > $(".ajaxApplyIgnore ", obj).addClass("red"); // select the element in our > refference > }); // you need this > > > > On Thu, May 21, 2009 at 8:11 PM, aquaone wrote: > >> $("test") should be $("#test"). >> >> aquaone >> >> >> On Wed, May 20, 2009 at 17:44, sean wrote: >> >>> >>> I have the following code: >>> >>> >>> Test1>> span> >>> >>> >>>Logout >>> >>> >>> >>> >>> >>> var obj = $('test'); // used specific div, as this is in a huge >>> document >>> obj.find('.ajaxApplyIgnore a').addClass('red'); >>> >>> >>> The js code above will not select the Test1 link, even though it is >>> found within the div layer with the ajaxApplyIgnore class. It seems >>> that the selector does not work recursively. >>> >>> Does anybody know how to make the script work recursively this? >>> >>> NOTE: I am using Safari 3. >>> >> >> >
[jQuery] Plugin Best practices?
I use three or four jquery plugins for a site. What's the best practice in loading all of these files and how much does it slow down an app? Do you reference them from another file to keep the page code clean? Just a couple of questions to find out about . . . . Thanks, Rich
[jQuery] Re: jQuery, MooTools, and Prototype - A Comparison
All 3 frameworks have pros and cons. They have many technical similarities and each come with their own set of problems. If you can avoid using a framework, always do that. But if the pros of using a framework outweigh the cons, I think the decision mostly comes down to popularity. Choose the framework that will have the most documentation, the biggest user community, will be around the longest, will have the most number of developers familiar with it, and can be seen as gaining in popularity rather than declining. If you look at Google Trends to compare the three: http://www.google.com/trends?q=jquery+javascript%2Cmootools+javascript%2Cprototype+javascript you'll see that MooTools and Prototype are steady or declining, while jQuery has a dominant lead in popularity and is increasing rapidly. Granted, this is only an analysis of searches, but it's a fair picture of relative popularity of the different frameworks. There is always some safety in choosing the "market leader" and if you are going in blind with no desire to do an in-depth analysis of each option, then choosing jQuery would probably be your safest best. IMO, Matt Kruse On May 21, 2:05 pm, kiusau wrote: > After a badly needed pause of some length, my need for sophisticated > JavaScript has reemerged. During my departure I have discovered two > other similar JavaScript modules called MooTools and Prototype. With > my reemergence I have also realized that all of these require a > certain amount of commitment that goes beyond what I initially > anticipated. What I would like from you all is a convincing argument > to remain that is based on the following comparison: > > 1) What are the principal advantages of jQuery over Prototype and > MooTools? > 2) What are the principal disadvantages of jQuery when compared with > Protoype and MooTools? > > Roddy
[jQuery] Re: jQuery, MooTools, and Prototype - A Comparison
On May 21, 12:23 pm, David Meiser wrote: > If you can't bear that thought, just *choose* one. None of my friends were > using jQuery when I started using it (now I've converted all of them), but I > read an article saying that it was going to be included in ASP.NET MVC and > VS 2010. So, I gave it a shot, liked it, so I continue using it. I am not sure that it makes a difference, but I am a dedicated Mac user. One other important issue that I forgot to mention is that for the moment I have no server-side capability, but will eventually move away from my client-side only constraint. Roddy
[jQuery] Change keyCode of triggered event...
Hi, all.. I need to change a keycode of triggered event... What I need to do, is when a user pressing right + key on the numpud, I need it to be "TAB" instead... Since I cannt know when on the screen he will do it, I cannt use itaration of elements... I cannt know what will be the next element... here is the code I tried, any help will be appriciated.: Code: $(function() { $("form input").keydown(function (e) { if ((e.which && e.which == 13) || (e.keyCode && e.keyCode == 13)) { // alert('SUBMIT '+this.name) ; return false; } else if ((e.which && e.which == 107) || (e.keyCode && e.keyCode == 107)) { // alert('SUBMIT '+this.name) ; //$("form input").val('value').trigger( "keypress", [9] ); alert('Main:' + e.keyCode); e.keyCode=9; $(e.target).trigger(e); // var objE = new jQuery.Event("keydown"); // objE. // $(e.target).trigger({ // type:"keydown", // keyCode:9 //}); return false; } else { alert('Error: '+e.keyCode); return true; } }); the 107 is the keyCode of the right + on the numpud, and 9 is TAB key.
[jQuery] $.get() fetch a list of images
Hi all! I'm facing a problem, and it seems very unlogical that it doesn't work. I've written a function to switch some images on a clients website. It takes images from an array, and displays them with some nice fades. Now I'm trying to fetch these images using AJAX, initially from a text file, later I'll fetch them from a php script which fetches them from a database. The script outputs like this: image1.png,image2.png,image3.jpg,image4.jpg,image5.png in the script I use the following to split it into an array: var splitted; var path = 'uploads/slideshow/'; $.get('ajax.txt', function(data) { splitted = data.split(','); console.log(splitted); // outputs to firebug to check if GET worked }); var slide = $(elm).attr('slide'); var total = splitted.length; var next = slide+1 var picture = splitted[next]; $(elm).fadeOut(1000, function() { $(elm).attr('slide', next).css('background', 'url('+path+picture +')'); $(elm).fadeIn(1000); }); but somehow, the $.get() part outputs nicely to the console, but after that console gives an error that total splitted.length cannot be determined because splitted is undefined! quite strange isn't it? I tried to remove the console.log(), tried to define the img array before $.get() and populate it inside the $.get(). Nothing works! What should I do, and more important, why does it behave like this? thanks, Fabian
[jQuery] Cut string from this position an onward...
I need to simupate AS/400 keybord work... I need to be able to do when a key is pressed, to delete all text from the position of the pointer (which means that if I am in the middle of the word then cut the right part of it) and to move to the next input field. How can I do that?
[jQuery] [validate] multiple errorClass question
To get the effect I want, I've had to patch the jquery validate library. Is there a simpler method instead? Problem: I want my error label element to have two classes, and for it's distant parent to have a class, so I do some tweaking to the label argument of the errorPlacement option. When validation runs, it resets the classes on the label and adds the 1 error class. So I see a flash of what I want for a second. Initial Solution: jquery.validate.js line 600 (inside of showLabel) - label.removeClass().addClass( this.settings.errorClass ); + label.addClass( this.settings.errorClass ); Is there a better way? I'd rather not patch validate. Ideally a callback after showLabel or something. Great library BTW!
[jQuery] Re: Licensing
On Thu, May 21, 2009 at 12:15 PM, doddstr13 wrote: > > Are all jquery plugins available under GPL and MIT licenses? No. Each plugin author can choose their own license. > My > company requries me to provide a URL which describes the licensing of > any open source code we use. I have links to JQuery's licensing, but > I want to use ClueTip plugin and can't find any specific licensing > informaitno. > See http://plugins.learningjquery.com/cluetip/jquery.cluetip.js Lines 1-10: /* * jQuery clueTip plugin * Version 1.0.1 (May 18, 2009) * @requires jQuery v1.2.6+ * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */ - Richard
[jQuery] Re: loading message
Hi guys, thanks for your replies. I tried the binding but looks like it doesn't work but ajaxStart- ajaxStop works just fine so I will go with it. Have a nice day! Sig On May 20, 9:00 pm, gk wrote: > One way to do this is to use global events of jquery ajax, as below > > $("#ajaxLoading").bind("ajaxSend", function(){ > $(this).show(); > }).bind("ajaxComplete", function(){ > $(this).hide(); > }); > pls note this will show a loading message for all jquery ajax > operations from your page, if you want to restrict only to a specific > operaton you can bind this to current ajax call. > --- > Loading.. > --- > #ajaxLoading{ > position: absolute; > top:2px; > left:95%; > padding:5px; > background-color: #CC; > color:white; > > } > macsig wrote: > > Hi guys, > > I'm working on a Rails app connected to a legacy database. > > Since the reading process from the database takes several seconds (up > > to ten) I would like to display a loading message while the page is > > loading. > > > Can I achieve that using jQuery? If so how? > > > Thanks and have a nice day. > > > Sig
[jQuery] Re: jQuery, MooTools, and Prototype - A Comparison
jQuery, prototype, and MooTools all provide very good to excellent FAQs and documentation on their respective websites. Barring that, why not just mock up some simple interface (say, something with an accordion interface, making an AJAX call to a static HTML file to replace some content) and try it on all three to see what you like. If you can't bear that thought, just *choose* one. None of my friends were using jQuery when I started using it (now I've converted all of them), but I read an article saying that it was going to be included in ASP.NET MVC and VS 2010. So, I gave it a shot, liked it, so I continue using it. I have friends that swear by YUI, and that's fine for them. I have a friend that would rather fall on his sword than stop using Scriptaculous. But you don't even have to go that far - jQuery has a compatibility mode, YUI uses it's own namespace, etc, etc. You don't have to choose *one* framework (although, I'd recommend it). On Thu, May 21, 2009 at 3:05 PM, kiusau wrote: > > After a badly needed pause of some length, my need for sophisticated > JavaScript has reemerged. During my departure I have discovered two > other similar JavaScript modules called MooTools and Prototype. With > my reemergence I have also realized that all of these require a > certain amount of commitment that goes beyond what I initially > anticipated. What I would like from you all is a convincing argument > to remain that is based on the following comparison: > > 1) What are the principal advantages of jQuery over Prototype and > MooTools? > 2) What are the principal disadvantages of jQuery when compared with > Protoype and MooTools? > > Roddy
[jQuery] Re: animate padding start value - Firefox (getComputedStyle)
Maybe I'm wrong, but I think myElement.animate( {padding: 12px} ) won't work anyway ? Shouldn't it be myElement.animate( {padding: 12} ) That said, tests here show that only IE & Opera offer a smooth animation - the others (FF, Chrome & Safari) seem to jump L Jason Persampieri wrote: (Firefox 3.0.10, OS X) I am setting a padding value via a stylesheet and trying to animate it - - CSS myElement { padding: 20px } - Javascript myElement.animate( {padding: 12px} ) When calculating the start padding value, jQuery calls 'getComputedStyle'. Unfortunately, computedStyle.padding = "" computedStyle.padding-top = "20px" computedStyle.padding-right = "20px" computedStyle.padding-bottom = "20px" computedStyle.padding-left = "20px" and the call to 'getPropertyValue' returns an empty string (which is translated to 0px). Would this be considered a jQuery or Firefox issue? No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: 270.12.36/2126 - Release Date: 05/21/09 06:22:00
[jQuery] Licensing
Are all jquery plugins available under GPL and MIT licenses? My company requries me to provide a URL which describes the licensing of any open source code we use. I have links to JQuery's licensing, but I want to use ClueTip plugin and can't find any specific licensing informaitno.
[jQuery] jQuery.extend(deep) not working?
I'm trying out this need extension: http://binarykitten.jkrswebsolutions.co.uk/2009/01/21/jquery-plugin-ajax-head-request/comment-page-1 which allows jQuery to do a HEAD request on an arbitrary URL in order to grab header values for a given page. Unfortunately, if that page is the page the script is currently running from, it goes into an infinite loop which results in: [Exception... "Component returned failure code: 0x80004001 (NS_ERROR_NOT_IMPLEMENTED) [nsIDOMLocation.host]" nsresult: "0x80004001 (NS_ERROR_NOT_IMPLEMENTED)" location: "JS frame :: http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js :: anonymous :: line 12" data: no] [Break on this error] (function(){var l=this,g,y=l.jQuery,p=l.each (function(){o.dequeue(this,E)})}}); If I add deep to jQuery.extend(), I get "deep is not defined". Does anybody have any help for this? Should the code be refactored to not extend but to be a more simplistic?
[jQuery] Re: Question about Click Function
ps: strange behaviour can be seen live here: http://www.les-elites.org/index.php?article_id=126&clang=0
[jQuery] jQuery, MooTools, and Prototype - A Comparison
After a badly needed pause of some length, my need for sophisticated JavaScript has reemerged. During my departure I have discovered two other similar JavaScript modules called MooTools and Prototype. With my reemergence I have also realized that all of these require a certain amount of commitment that goes beyond what I initially anticipated. What I would like from you all is a convincing argument to remain that is based on the following comparison: 1) What are the principal advantages of jQuery over Prototype and MooTools? 2) What are the principal disadvantages of jQuery when compared with Protoype and MooTools? Roddy
[jQuery] Re: Code Review: slideshow plugin using JSON
You have to love the public domain. Thanks again and I look forward to your feedback. Stefan On May 21, 2:49 pm, chris thatcher wrote: > nice work stefan, i checked out the example and will look under the covers > sometime tonight. I'm actually at the library of congress (i work here) so > it was great to see those images from our prints and photographs division. > > > > On Thu, May 21, 2009 at 12:01 PM, Stefan Hayden wrote: > > > I was looking for a jQuery slideshow that worked the way I wanted and > > didn't find one. I figured you can never have too many slideshow > > plugins so I've tried to make my first jQuery plugin and was hoping > > people with a bit more jQuery experience could look it over and give > > some suggestions before I go around telling people about it. > > > This slideshow requires the first slide to be in the HTML and then it > > preloads the next image in the rotation just before showing it making > > the initial page load time faster. It also has previous/next and > > pagination interfaces and well as an option to show a animated > > caption. > > > plugin homepage:http://stefanhayden.com/shermanstravel_slideshow/ > > plugin source: > >http://stefanhayden.com/shermanstravel_slideshow/jquery.ShermansTrave... > > > any feedback would be welcome. > > > Stefan Hayden > > -- > Christopher Thatcher
[jQuery] Re: Question about Click Function
Ok - so far i got it to work. The reason why the things didnt work was because the functions weren´t loaded on (document).ready. One solved next problem comes... i want it that way, once next button in row is activated the previous shouldnt work any more until the next one is deactivated. tried it with unbind - that works but when i rebind the original function it shows some really strange behaviour like working only on second click then flickering and goes to desired state. Can anyone give me please a hint how to proceed? Is it possible to make these functions a little more generic? Thanks for help! $(document).ready(function() { $('#desperation input[type=image]').attr('disabled', true).fadeTo ("fast", 0.10); $('#1').attr('disabled', false).fadeTo("fast", 0.40); $("#1").toggle( function () { $("#2").attr("disabled", false).fadeTo("fast", 0.50); $("#1").val("underdog").fadeTo("slow", 1.00);; }, function () { $("#2").attr("disabled", true).fadeTo("slow", 0.10); $("#1").val("").fadeTo("slow", 0.50); } ); $("#2").toggle( function () { $("#3").attr("disabled", false).fadeTo("fast", 0.50); $("#2").val("dump_guns").fadeTo("slow", 1.00); }, function () { $("#3").attr("disabled", true).fadeTo("slow", 0.10); $("#2").val("").fadeTo("slow", 0.50); } ); $("#3").toggle( function () { $("#4").attr("disabled", false).fadeTo("fast", 0.50); $("#3").val("desperation_fire").fadeTo("slow", 1.00); }, function () { $("#4").attr("disabled", true).fadeTo("slow", 0.10); $("#3").val("").fadeTo("slow", 0.50); } ); $("#4").toggle( function () { $("#5").attr("disabled", false).fadeTo("fast", 0.50); $("#4").val("rum_ration").fadeTo("slow", 1.00); }, function () { $("#5").attr("disabled", true).fadeTo("slow", 0.10); $("#4").val("").fadeTo("slow", 0.50); } ); $("#5").toggle( function () { $("#5").val("hasty_fire").fadeTo("slow", 1.00); }, function () { $("#5").val("").fadeTo("slow", 0.50); } ); }); Freetrader Skills: Desperation
[jQuery] Re: Refresh SPAN without entire page
What do you mean "refresh span" ? You can reset the content of a particular SPAN using $(spanReference).html("NEW CONTENT") or $(spanReference).text("NEW CONTENT") But unless you've changed the content of the SPAN (using one of the above, in which case you already know it), what's there to refresh ? L bharani kumar wrote: Hi All, How to Refresh SPAN without page refresh , Can you tell name of the jquery function , -- ?? ?? ?? Regards B.S.Bharanikumar POST YOUR OPINION http://bharanikumariyerphp.site88.net/bharanikumar/ No virus found in this incoming message. Checked by AVG - www.avg.com Version: 8.5.339 / Virus Database: 270.12.35/2124 - Release Date: 05/20/09 06:22:00
[jQuery] Re: Code Review: slideshow plugin using JSON
nice work stefan, i checked out the example and will look under the covers sometime tonight. I'm actually at the library of congress (i work here) so it was great to see those images from our prints and photographs division. On Thu, May 21, 2009 at 12:01 PM, Stefan Hayden wrote: > > I was looking for a jQuery slideshow that worked the way I wanted and > didn't find one. I figured you can never have too many slideshow > plugins so I've tried to make my first jQuery plugin and was hoping > people with a bit more jQuery experience could look it over and give > some suggestions before I go around telling people about it. > > This slideshow requires the first slide to be in the HTML and then it > preloads the next image in the rotation just before showing it making > the initial page load time faster. It also has previous/next and > pagination interfaces and well as an option to show a animated > caption. > > plugin homepage: http://stefanhayden.com/shermanstravel_slideshow/ > plugin source: > http://stefanhayden.com/shermanstravel_slideshow/jquery.ShermansTravel_Slideshow.js > > any feedback would be welcome. > > > Stefan Hayden > > > -- Christopher Thatcher
[jQuery] Re: SOT: execute JS before a specific image loads
I did not see your response Michael...bummer. It might have changed our approach. Regardless we've got the desired functionality in place already. Thanks for your time. andy _ From: jquery-en@googlegroups.com [mailto:jquery...@googlegroups.com] On Behalf Of Michael Geary Sent: Thursday, May 21, 2009 12:32 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: SOT: execute JS before a specific image loads Hmm... This is weird... I posted a reply at 3PM yesterday and it doesn't look like it made it onto the group. (You didn't see it, did you?) So here goes again, with some additional notes this time... The problem is really much easier than all this. There's no reason to use a lazy load plugin, and no reason to even use jQuery. Simply use a tag for the non-JavaScript case, and a tag with document.write() for the JavaScript case: