[jQuery] Re: UI Autocomplete documentation
Thank you very much, Any idea when the 'official' documentation might be ready? On Sep 30, 6:56 pm, MorningZ <[EMAIL PROTECTED]> wrote: > Documentation:http://docs.jquery.com/Plugins/Autocomplete > > And it's Jorn's autocomplete plugin that is getting rolled > in:http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ > > On Sep 30, 4:57 pm, mario <[EMAIL PROTECTED]> wrote: > > > Hi, > > > Im using the latest UI rc2 and I am going to use the autocomplete that > > comes with Jquery UI 1.6, but I can't find any documentation, I read > > it was based on a plugin and i think i should use that documentation, > > but don't know which autocomplete plugin it is based on. > > > Thanks, > > Mario
[jQuery] Animation delayed after many clicks
I am building a gallery with transitions and am finding some bugs that I'm not able to figure out. Any help would be appreciated. The URL: http://ryanfitzer.com/dev/wp-sandbox/portfolio/gallery-four The Issue: When one clicks on a thumbnail it switches out the large image and fades it in. If the large image is smaller or larger than the previous image the content below (the footer) animates up/down accordingly. After clicking around on the thumbnails for a bit the up/down animation becomes delayed. It takes 10-15 seconds to fire at times. I'm thinking this is a cache issue (?). The relevant function: function imageSwap() { // When a thumbnail gets clicked jQuery('.pr-thumbs a').click(function(){ // Set the height of the gallery var gallery = jQuery('.pr-gallery'); var galleryHeight = gallery.height(); gallery.height(galleryHeight); // Gather some variables var thumb = jQuery(this); var lgImage = jQuery('.pr-galleryfullsize img'); var caption = jQuery('.pr-caption'); var href = thumb.attr('href'); var alt = thumb.attr('title'); var src = lgImage.attr('src'); // Add the loading class to the thumb thumb.addClass('loading'); // Size the spinner element to the thumbnail size for centering var loaders = jQuery('.thumb-loading-wrapper, .thumb-loading- spinner'); var imgHeight = thumb.children('img').height(); var imgWidth = thumb.children('img').width(); var loaderCSS = { width: imgWidth, height: imgHeight } loaders.css(loaderCSS); // Test to see if the thumb that was clicked is not already showing if(href !== src) { // Fade the caption and insert the new caption text caption.fadeOut('fast', function(){ caption.css('display', 'none').html(alt); }); // Fade the large image and change out the src attribute lgImage.fadeOut('fast', function(){ lgImage.css('display', 'none').attr('src', href); // Once the large image has finished loading... lgImage.load(function(){ // Remove the thumb's loading class thumb.removeClass('loading'); // Animate the height of the gallery to match height of large image var lgImageHeight = lgImage.height(); gallery.animate({ height: lgImageHeight+39 }, 250, function(){ // Fade the image in lgImage.fadeIn('slow'); caption.fadeIn('slow'); }); }); }); } else { thumb.removeClass('loading'); } return false; }); } Thanks for any help you can give me. Also, if you have any feedback as to a better way to accomplish any of this behavior I would be very appreciative. Ryan
[jQuery] Re: superfish navbar
i know i look like an idiot posting to my own posts (and answering my own questions), but i wanted to post the solution i found in case someone else had the same problem. after looking around at other peoples' questions (and source codes) i noticed that a negative z- index makes my navbar work great. (i put a negative z-index on class for my slideshow and the navbar has a 100 z-index)
[jQuery] Re: calling jquery cycle function from flash
hey. after i sent you that question to your question (sorry), i looked at your html and css and saw a negative z-index on your masterhead and flash id's. i tried that, and my navbar works great now. thanks! On Sep 30, 5:17 pm, Slushbunny <[EMAIL PROTECTED]> wrote: > Hi, I'm using this http://malsup.com/jquery/cycle/jquery cycle plugin for > a slideshow on http://dev.emsix.com/renaissance/default2.aspthis page . > > I have 2 images to rotate in the graphic masthead, each with a flash movie > overlay (the yellow text). Instead of having the images cycle automatically, > I'd like to call that function from Flash. In other words, I want to dictate > when the image should change at a certain point in my flash movie. > > I'm not sure at all how to do this. I've tried to tuck the cycle code into a > new javascript function, and then call that from flash, but no dice. I'm a > newbie when it comes to any function-writing, so any help would be much > appreciated. Thank you! > -- > View this message in > context:http://www.nabble.com/calling-jquery-cycle-function-from-flash-tp1975... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Scope Of Variables Inside Functions
You'll find that you'll likely never have to do a for loop like that using jQuery. And in your sample the function is being attached to the mouseover event 5 times. If you need access to a variable outside the function scope make it a property of a global object, like: var QuickScriptz; // store stuff here $(document).ready(function(){ // Loop it five times for(var i = 1; i <= 5; i++){ // Declaring the variable QuickScriptz.x = i; $(".fade").mouseover(function(){ $(this).fadeTo(10,QuickScriptz.x); }); } }); And then you have a fadeTo() function being called 5 times in a row for the same element, with different values :) This might work the way you wanted originally, not tested (not sure this closure works with jQuery binding) and ugly as hell (don't do it): $(".fade").mouseover((function(x){ return function(){ $(this).fadeTo(10,x); }})(x)); - ricardo On Sep 29, 11:25 pm, QuickScriptz <[EMAIL PROTECTED]> wrote: > Okay, so first off, I recently started using jQuery, and it is by far > the best and easiest to use/understand framework that I have ever > used. Huge props to the developers and the community! You guys rock! > > Anyway, I've read over the jQuery Documentation but I am left a bit > fuzzy as to the whole idea of the scope of variables within functions. > > Say I have a variable (x) inside a for loop which is inside my $ > (document).ready. If I want to create a function inside my for loop > (like a mouseover event), is it possible to access (x) from inside > this function? > > Here is an example to clarify: > > $(document).ready(function(){ > > // Loop it five times > for(var i = 1; i <= 5; i++){ > > // Declaring the variable > x = 0; > > $(".fade").mouseover(function(){ > $(this).fadeTo(10, x); > }) > }} > > > > Is there some type of shortcode or easy way to access the value of (x) > from within the mouseover function?
[jQuery] Re: fadein/fadeout conflicting
fadeOut() actually sets display:none at the end of the animation, so when this happens it triggers the onmouseout event. Try using the fadeTo() function (http://docs.jquery.com/Effects), it keeps the element in place: $("a").hover( function() { $(this).css("background", "white").fadeTo(500,0); },function() { $(this).css("background", "black").fadeTo(100,1); }); And make sure your doesn't have any child elements, otherwise the hover function will be called repeatedly on mouse move. - ricardo On Sep 29, 8:42 pm, backdoc <[EMAIL PROTECTED]> wrote: > I'm brand new to jQuery. And, I'm wanting to make something fadeOut > when I hover or mouseover and fadeIn when I mouseout. I tried the two > methods below. But, when I leave the mouse cursor positioned over the > element, I get an unwanted blink effect. It seems that when the > fadeOut() ends, it triggers the next method. I wouldn't expect that. > > I figure this is probably jQuery 101. But, I couldn't find the answer > in the archives. > > Any suggestions? > > TIA, > backdoc > > > $(document).ready(function() { > $("a").click(function(e) { > e.preventDefault; > //alert("Hello world!"); > }); > $("a").hover( > function(e) { > $(this).css("background", "white"); > $(this).fadeOut(500); > }, > function(e) { > $(this).css("background", "black"); > $(this).fadeIn(100); > }); > /* > $("a").mouseover( > function(e) { > //alert(this.id); > $(this).css("background", "yellow"); > $(this).fadeOut(500); > }); > $("a").mouseout( > function(e) { > $(this).css("background", "black"); > $(this).fadeIn(100); > }); > */ > }); >
[jQuery] Re: calling jquery cycle function from flash
your site looks great. not sure why you want to change anything, but why wouldn't you want to put the photos in flash, and control them inside flash? maybe because it would create a huge flash file? i have my own issues with cycle.jquery maybe you can help me. i'm using the cycle.jquery.js library for a slide show, and i have a drop down navbar above it, but when it drops down, it falls behind the slide show. how did you get your flash overlay to play on top of your cycle.jquery slides? did you use a z- index in the css? On Sep 30, 5:17 pm, Slushbunny <[EMAIL PROTECTED]> wrote: > Hi, I'm using this http://malsup.com/jquery/cycle/jquery cycle plugin for > a slideshow on http://dev.emsix.com/renaissance/default2.aspthis page . > > I have 2 images to rotate in the graphic masthead, each with a flash movie > overlay (the yellow text). Instead of having the images cycle automatically, > I'd like to call that function from Flash. In other words, I want to dictate > when the image should change at a certain point in my flash movie. > > I'm not sure at all how to do this. I've tried to tuck the cycle code into a > new javascript function, and then call that from flash, but no dice. I'm a > newbie when it comes to any function-writing, so any help would be much > appreciated. Thank you! > -- > View this message in > context:http://www.nabble.com/calling-jquery-cycle-function-from-flash-tp1975... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Setting the selected item in a combo box
'select' is the selector (:D) for the 'select' element, jQuery uses CSS selector syntax: Good Bad Ugly $('#dropdownstuff').val(value); or $('#parent select').val(value); or $('#parent > select').val(value); all do the same. now, a different issue is that you're using ajax to load data. You need to execute this function only after the data has been loaded, passing a callback function: $('#blah').load('http://options.com',function(){ $('#blah select').val(value); }); doing one after the other won't work, the val() function will run before the ajax load is finished. cheers - ricardo On Sep 30, 7:52 pm, Pete <[EMAIL PROTECTED]> wrote: > Ricardo, > I am a bit new at using jQuery so this could be an inane question: > Is the 'select' applied at the selector? If my control's id is > emplist would the correct syntax be: > > $('#emplist select').val(empSelected); > > empSelected, in this case, is a variable containing the value I want > to set the 'selected' attribute for. > > This page is a template rendered by a server call and the server sets > the value of each of the fields of the form. But I want each field to > have the values that can be selected. The complete code is: > > // Load the list using Ajax and Json: > $('#emplist').loadList(getEmpListURL, '#emplist'); > // Then set the value of the selected option > $('#emplist select').val(empSelected); > The list is populated but the option value is not set to 'selected' > > On Sep 29, 5:27 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > $('select').val('value') should work (it needs to be applied to the > > , not the > > > - ricardo > > > On Sep 29, 6:55 pm, Pete <[EMAIL PROTECTED]> wrote: > > > > I have an element that I populate with an Ajax call and returns a list > > > of items for a combo box. In some cases the page containing the > > > element gets loaded with existing values and rendered and I'd like the > > > textbox to contain an item that was selected before the element is > > > rendered. > > > > Is there a way to set that value? I have done some searching but > > > haven't found a solution as yet. I have looked at setting the > > > "selected" attribute but haven't found an example that works. I have > > > also tried setting the selected value with .val(myValue); but, again, > > > tried it and didn't get it to work. > > > > It should be simple. But I can't seem to crack it. Suggestions? > > > > Thanks, > > > > Pete
[jQuery] Re: I want to reduce the header calls
My advice is to quit on this one. Even if you can capture the HTTP request at the server what are you going to do with it? The server is already 'capturing' the requests and telling the browser when it has already downloaded the .swf - it IS only downloaded once, but you have to wait for each request to be answered so that the browser is told "you already have this file". There is no alternative possible. But if you used the canvas object or pure XHTML that would be another story :) - ricardo On Sep 30, 7:59 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > lol... sorry After I read through again... I totally missed the java > server part... but on the other... I posted in the wrong spot... sorry > about that...> I thought you were looking for a way to download your .swf > once instead of > > starting a bunch of simultaneous downloads for it. > > that is what I am after here... controlling downloads of componets > called by jquery... I think this would be handy for a lot of other > things to... well I hope I haven't lost anyone ... :-) need all the > help I can get here... thanks again... > jeremyBass > > On Sep 30, 2:12 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote: > > > I am really lost now. > > > I thought you were looking for a way to download your .swf once instead of > > starting a bunch of simultaneous downloads for it. > > > I don't think a clone of mod_rewrite for Java servers would help you at all. > > (Is your server code in Java? Even if it is, it wouldn't help - you're > > trying to avoid hitting the server in the first place.) > > > Now you found some JavaScript code to detect the user's language. How is > > that connected with the download issues? > > > (scratching head) > > > -Mike > > > > From: jeremyBass > > > > found this... may-be this may help ??? > > > > > > > if (navigator.browserLanguage){language=navigator.browserLanguage} > > > if (navigator.userLanguage){language=navigator.userLanguage} > > > if (navigator.systemLanguage){language=navigator.systemLanguage} > > > if (navigator.language){language=navigator.language} > > > if (language.indexOf('-')==2) {language=language.substring(0,2);} > > > if (language=='en') { document.write("Hello there!"); } > > > else if (language=='jp') { document.write("Konichiwa!"); } > > > else if (language=='fr') { document.write("Bonjour!"); } > > > > On Sep 30, 9:47 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > So I think this is the ticket... but I really am not to sure on the > > > > how yet... > > > > >http://code.google.com/p/urlrewritefilter/ > > > > > anyone have a sec to help me out with this? thank you jeremyBass > > > > > On Sep 29, 7:37 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > I new that was to good to be true... well moving on to a > > > new view > > > > > There has to be a way to "capture" the HTTP requests ... I think > > > > > I've seen URL rewrites with javascript... so may-be I > > > could have it > > > > > so that it's more like this... if HTPP request is in > > > array die else > > > > > execute and push URL to array? any ideas on that? > > > > > > thanks for the help... > > > > > jeremyBass > > > > > > On Sep 29, 4:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > > Oops, sorry, what I meant is that cloning the elements > > > is the best > > > > > > optimization you can do. It will save you some processing time > > > > > > from not creating new elements (or maybe not, as jQuery will be > > > > > > re-creating the clone element), but the HTTP requests > > > will remain. > > > > > > > $('#flash-round-corner- > > > > thing').clone().appendTo('newcorner').clone().appendTo('anothercor > > > > > > ner') > > > > > > etc. > > > > > > > On Sep 29, 1:08 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > > Thank you for the help... > > > > > > > > >>> And using dozens of flash objects to round > > > corners doesn't > > > > > > > >>> seem like a good idea... > > > > > > > > Yeah I thought there would be alot of trouble to at > > > first... but > > > > > > > it's better then cornflex and jcorner altogether... it's > > > > > > > absolutely working perfectly. the 10-12 calls are on > > > the first > > > > > > > download only and it's not the round boxes... it's mostly the > > > > > > > srif anyways... but that's ok... I'm just being anal > > > and trying > > > > > > > to work out everything before I share this with > > > everyone. right > > > > > > > now the round box mod is total 1kb big if you already have > > > > > > > jflash.js. And it's... well I'll share this all in > > > bit... I want to protect it and have never done that before... > > > > > > > like a gpl? or something... anyways... > > > > > > > > >>> If the element is already being cloned instead of being > > > > > > > >>> created again, > > > > > > > >>> there is no fix. > > > > > > > > so if they aren't? I could reuse the element with > > > the new vars? > > > > > > > then I would only have made one call as long as I > > > don't cha
[jQuery] Re: Superfish Basic (horizontal)- How to go right across the screen
to go right all the way across the screen, i put my and tags in a tag, and gave the div tag the same background (color or image) as the navbar. that worked for me. let me know if that helps you. regarding removing the padding to make it go all the way to the top, i had this happen to me on something similar. if you put your superfish bar in a div tag, give the div tag an id, then in your css, use a relative position about -14px at the top. look at the code on my site if you want. http://www.claxtondrugstore.com the style sheet is tdsStyles.css so use this address to see it http://www.claxtondrugstore.com/tdsStyles.css this site does not have a superfish navbar, but this should fix the issue of pushing everything up flush to the top. i used a with the id of wrapper and the css looks like this on mine: #wrapper { position: relative; top: -15px; background-image: url(assets/edgeGradient5.jpg); background-repeat: repeat-y; background-position: center; } On Sep 30, 11:33 pm, yvonney <[EMAIL PROTECTED]> wrote: > Hi everyone... > > [FULL width across the entire page needed] > > Loving Superfish > > got the basic example up... just need to to go RIGHT across the entire > screen even if there's just the 4 menu items on the left. Also i'd > like to remove the padding and be able to have it totally at the top > of the page... > I have'nt been able to figure out, yet how to get it to go full > width... > > Can anyone tell me what I change in the css? > Geez, that does feel like a silly question though it could be one of > those ones that takes a day or so for me... > AND, I've just had the most terrific week and a bit really getting > into JQ, so maybe I'm a little weary. > > Thanks whatever happens!
[jQuery] Re: Adding class to a parent element- traversion help?
Try an ugly filter function: $(".bc-wrapper").filter(function(){ return !/^\s+$/.test(this.textContent); // "\s" is a shorthand for whitespace/line breaks }).parent().addClass("none"); This will exclude from your selector all elements that have only whitespace in it. Be weary that regexes are slow, you don't want this code looping over a thousand elements. - ricardo On Sep 30, 8:56 pm, Vinoj <[EMAIL PROTECTED]> wrote: > @Michael Geary -- Thanks, now I get it. But the code is being output > by a CMS, which has some whitespace that is output. So then truncate > the whitespace? > @FrenchilNLA -- It seemed to make sense, but this didn't work as long > as I had that extra space. Once I took out the whitespace that Michael > Geary spoke of, it worked. Is there a way to basically have the :empty > selector work and ignore whitespace? > > Thanks from both of you for responding, I really appreciate it.
[jQuery] Re: Assign 'active' to nav element
Yes, that is why I am seeking some assistance. Not sure how to implement it within my current code. I know how to assign the class as active, but how would I go about making it assign an active class to the h2 element when it is selected? Needless to say I'm a bit of a newbie and was just hoping for some suggestions. Thanks Michael Geary-3 wrote: > > > I don't see anything in your code that resembles your description of what > you want. I'd expect to find an addClass('active') call in there > somewhere. > I see a bunch of other code, but nothing like that. > > Perhaps that is the problem, the code you need simply isn't there? > > -Mike > >> From: yellowboy >> >> I want my h2 element to be assigned class 'active' when >> selected, I have tried numerous methods but to no avail, some >> guidance would be appreciated! >> >> function initMenus() { >> $('div.menu div.gallery').hide(); >> $.each($('.menu'), function(){ >> $('#' + this.id + '.expandfirst >> div.gallery:first').show(); >> }); >> $('div.menu h2').click(function() { >> >> var checkElement = $(this).next(); >> var parent = this.parentNode.parentNode.id; >> >> if($('#' + parent).hasClass('noaccordion')) { >> $(this).next().slideToggle('normal'); >> return false; >> } >> if((checkElement.is('div.gallery')) && >> (checkElement.is(':visible'))) { >> if($('#' + >> parent).hasClass('collapsible')) { >> $('#' + parent + ' >> div.gallery:visible').slideUp('normal'); >> } >> return false; >> } >> if((checkElement.is('div.gallery')) && >> (!checkElement.is(':visible'))) { >> $('#' + parent + ' >> div.gallery:visible').slideUp('normal'); >> checkElement.slideDown('normal'); >> return false; >> } >> } >> ); >> } >> $(document).ready(function() {initMenus();}); >> -- >> View this message in context: >> http://www.nabble.com/Assign-%27active%27-to-nav-element-tp197 > 53801s27240p19753801.html >> Sent from the jQuery General Discussion mailing list archive >> at Nabble.com. >> > > > -- View this message in context: http://www.nabble.com/Assign-%27active%27-to-nav-element-tp19753801s27240p19754447.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: select data in a ignoring the
you can let the var go: $('p').each(function(){ if (this.firstChild.nodeName.toLowerCase() !="span") $(this.firstChild).wrap("").parent().css('color','red'); }); and less fail-safe but shorter (can catch the span if there is no text and the span is also empty): $('p').each(function(){ if (!this.firstChild.hasChildNodes()) $(this.firstChild).wrap("").parent().css('color','red'); }); au revoir - ricardo On Sep 30, 7:22 pm, Pedram <[EMAIL PROTECTED]> wrote: > Dear folks , > finally this is what I got > > $(p).each(function(){ > if(this.childNodes[0].nodeName.toLowerCase() !="span") > var newNode=$(this.childNodes[0]).wrap(""); > newNode.css('color','red'); > }); > > this is the shortest code , basically you can not treat as a SELECTOR > to a Text which is not in the Tag so everything goes Wrong Unless be > get the text with the jQuery and then Wrap it with a Tag after that it > is ready to do what ever We want if make it workable > in this 3 Line > 1- all P has been Filter > 2- all Children which are not in the Span are FIlter > RIght now we can not do something like this $(.).css(...) ; > because our Text is not a Selecter so > 3- we Wrap it with what ever we want and now it is ready for you to > work with it > > thanks a Lot Equally... and other Guys basically we could not work > with a text which is not Wrapped in a Tag ... > > On Sep 30, 11:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > Here's a better version of > > that:http://joeflateau.net/playground/testingpexcspan2.html > > > $( function(){ > > console.log($($ > > ("p").childNodesExclusive("span")).allDOMNodesToHTML()); > > > }); > > > // this function returns all child nodes for the given element, > > excluding those that have a property that matches > > jQuery.fn.childNodesExclusive = function(exclude, caseSensitive, > > DOMProperty) { > > DOMProperty = DOMProperty || "nodeName"; > > caseSensitive = (typeof caseSensitive != 'undefined') ? > > caseSensitive : false; > > > exclude = (!caseSensitive) ? exclude.toLowerCase() : exclude; > > > var nodes = []; > > > $(this).each( function() { > > $.each(this.childNodes, function(i, node) { > > var compare = (!caseSensitive) ? > > node[DOMProperty].toLowerCase() : > > node[DOMProperty]; > > if (exclude != compare) { nodes[nodes.length] = > > node; } > > }); > > }); > > > return nodes; > > > } > > > // this function converts all nodes to html, including text nodes > > // and ignoring invisible nodes > > jQuery.fn.allDOMNodesToHTML = function() { > > var valueTypeNodes = [ > > document.TEXT_NODE, > > document.ATTRIBUTE_NODE, > > document.CDATA_SECTION_NODE > > ] > > var ignoreNodes = [ > > document.PROCESSING_INSTRUCTION_NODE, > > document.COMMENT_NODE > > ] > > > var html = ""; > > > this.each( function(i, node){ > > if ($.inArray(node.nodeType, ignoreNodes) > -1) { > > //do nothing > > } else if ($.inArray(node.nodeType, valueTypeNodes) > -1) { > > html += node.nodeValue; > > } else { > > html += node.innerHtml; > > } > > }); > > > return html; > > > } > > > On Sep 30, 3:01 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > NodeType Named Constant > > > 1 ELEMENT_NODE > > > 2 ATTRIBUTE_NODE > > > 3 TEXT_NODE > > > 4 CDATA_SECTION_NODE > > > 5 ENTITY_REFERENCE_NODE > > > 6 ENTITY_NODE > > > 7 PROCESSING_INSTRUCTION_NODE > > > 8 COMMENT_NODE > > > 9 DOCUMENT_NODE > > > 10 DOCUMENT_TYPE_NODE > > > 11 DOCUMENT_FRAGMENT_NODE > > > 12 NOTATION_NODE > > > > from:http://www.w3schools.com/Dom/dom_nodetype.asp > > > > I had to check for nodeType == 3 since the text nodes do not have an > > > innerHtml property. Also, after some reading, I think 'node.nodeValue' > > > would be more "proper" over 'node.data' > > > > I'd like to see how you get it to work better with jQuery, or rather, > > > "native jQuery". I'll try it myself, but I'd like to see how others > > > would implement it. > > > > On Sep 30, 2:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > > > > > Wow amazing... it worked let me ask you question I think I can do it > > > > with jQuery .. > > > > do you know what does node.nodeType mean in javascript > > > > nodeType=1 what does that mean for each value ? > > > > thanks Pedram > > > > > On Sep 30, 8:29 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > I'm not sure how to do it in a "jQuery" way. But here's what I came up > > > > > with: > > > > > > $( function(){ > > > > > $("p").each( function() { > > > > >
[jQuery] Re: Assign 'active' to nav element
I don't see anything in your code that resembles your description of what you want. I'd expect to find an addClass('active') call in there somewhere. I see a bunch of other code, but nothing like that. Perhaps that is the problem, the code you need simply isn't there? -Mike > From: yellowboy > > I want my h2 element to be assigned class 'active' when > selected, I have tried numerous methods but to no avail, some > guidance would be appreciated! > > function initMenus() { > $('div.menu div.gallery').hide(); > $.each($('.menu'), function(){ > $('#' + this.id + '.expandfirst > div.gallery:first').show(); > }); > $('div.menu h2').click(function() { > > var checkElement = $(this).next(); > var parent = this.parentNode.parentNode.id; > > if($('#' + parent).hasClass('noaccordion')) { > $(this).next().slideToggle('normal'); > return false; > } > if((checkElement.is('div.gallery')) && > (checkElement.is(':visible'))) { > if($('#' + > parent).hasClass('collapsible')) { > $('#' + parent + ' > div.gallery:visible').slideUp('normal'); > } > return false; > } > if((checkElement.is('div.gallery')) && > (!checkElement.is(':visible'))) { > $('#' + parent + ' > div.gallery:visible').slideUp('normal'); > checkElement.slideDown('normal'); > return false; > } > } > ); > } > $(document).ready(function() {initMenus();}); > -- > View this message in context: > http://www.nabble.com/Assign-%27active%27-to-nav-element-tp197 53801s27240p19753801.html > Sent from the jQuery General Discussion mailing list archive > at Nabble.com. >
[jQuery] Re: superfish navbar
i tried to assign a z index (lower than the superfish navbar) to the slide show class, but it didn't help.
[jQuery] superfish navbar
i have a page using the superfish navbar, but i also have a slide show under the navbar using the jquery.cycle.js library. the navbar is working fine except that when the menu drops down, it falls behind the slide show. i'm guessing that there is some css code that will fix this, but i'm not sure how to do it. can anyone help? thanks.
[jQuery] Assign 'active' to nav element
I want my h2 element to be assigned class 'active' when selected, I have tried numerous methods but to no avail, some guidance would be appreciated! function initMenus() { $('div.menu div.gallery').hide(); $.each($('.menu'), function(){ $('#' + this.id + '.expandfirst div.gallery:first').show(); }); $('div.menu h2').click(function() { var checkElement = $(this).next(); var parent = this.parentNode.parentNode.id; if($('#' + parent).hasClass('noaccordion')) { $(this).next().slideToggle('normal'); return false; } if((checkElement.is('div.gallery')) && (checkElement.is(':visible'))) { if($('#' + parent).hasClass('collapsible')) { $('#' + parent + ' div.gallery:visible').slideUp('normal'); } return false; } if((checkElement.is('div.gallery')) && (!checkElement.is(':visible'))) { $('#' + parent + ' div.gallery:visible').slideUp('normal'); checkElement.slideDown('normal'); return false; } } ); } $(document).ready(function() {initMenus();}); -- View this message in context: http://www.nabble.com/Assign-%27active%27-to-nav-element-tp19753801s27240p19753801.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Superfish Basic (horizontal)- How to go right across the screen
Hi everyone... [FULL width across the entire page needed] Loving Superfish got the basic example up... just need to to go RIGHT across the entire screen even if there's just the 4 menu items on the left. Also i'd like to remove the padding and be able to have it totally at the top of the page... I have'nt been able to figure out, yet how to get it to go full width... Can anyone tell me what I change in the css? Geez, that does feel like a silly question though it could be one of those ones that takes a day or so for me... AND, I've just had the most terrific week and a bit really getting into JQ, so maybe I'm a little weary. Thanks whatever happens!
[jQuery] Re: Mechanics of jQuery
Olreich wrote: How does jQuery select classes, psuedo-classes, and IDs? What are the actual components of the source behind this? Please, do not respond with how I would use the jQuery class selection functionality. The source code is readily available, and quite informative. If you're looking for a detailed description of how to do this, John Resig's forthcoming book has an entire chapter on CSS Selector engines; it's available through Manning's Early Access Program. Cheers, -- Scott
[jQuery] Mechanics of jQuery
How does jQuery select classes, psuedo-classes, and IDs? What are the actual components of the source behind this? Please, do not respond with how I would use the jQuery class selection functionality.
[jQuery] Re: add/remove and recalculate index
variable html is this php file: Chapter $x Remove Chapter Chapter Title: Chapter Web Description: Chapter Full Description: Thumbnail URL: (Anamorphic ratio 2.35:1 ) / Thumbnail 142px x 60px Chapter Start Time: H:M:S.SSS Chapter End Time: H:M:S.SSS EOS; ?> MorningZ wrote: > > > its tough to diagnose without knowing what your variable "html" > returned by the $.ajax call is > > but working up an example trying to simulate it, this works as > expected items stay in order of adding plus the items adjust > their indexes automatically > > http://paste.pocoo.org/show/86671/ > > > > > On Sep 30, 5:37 pm, claudes <[EMAIL PROTECTED]> wrote: >> i have an interface that allows user to add chapters and remove any >> chapter >> from within the group. i'm having issues re-calculating the sort order. >> currently if user adds four chapters (1,2,3,4), removes 2 and adds two >> more >> the order becomes (1, 3,4,2,3). i know i need to so something with index >> calculation...but how to is what is confusing me. this is the code that >> performs the add remove. >> >> $("#chapter-append").click(function() { >> var chapterCount = new >> Number($("#chapter-count").val()); >> if (chapterCount <1) chapterCount=0; >> chapterCount = chapterCount +1; >> $("#chapter-count").val(chapterCount); >> >> var queryString = >> "add-chapter.php?chapter-number="+chapterCount; >> //alert(queryString); >> $.get(queryString, function(html) { >> // append the "ajax'd" data to the table body >> $("ol#add-chapter").append(html); >> $("ol#add-chapter li >> h4").bind('click', function() { >> var >> newChapter = "#chapter-"+chapterCount+"-container"; >> >> $(newChapter).remove(); >> >> chapterCount = chapterCount -1; >> >> $("#chapter-count").val(chapterCount); >> >> return false; >> }); >> $('textarea').autogrow({ >> minHeight: 144, lineHeight: 16}); >> >> $('textarea.for-url').autogrow({ minHeight: 24, lineHeight: 16}); >> }); >> return false; >> }); >> >> -- >> View this message in >> context:http://www.nabble.com/add-remove-and-recalculate-index-tp19750882s272... >> Sent from the jQuery General Discussion mailing list archive at >> Nabble.com. > > -- View this message in context: http://www.nabble.com/add-remove-and-recalculate-index-tp19750882s27240p19753117.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Fire bug error : too much recursion
Are you using the JSON library from json.org? If so, make sure it's the json2.js one, rather than the earlier, and slightly "broken", one. http://www.json.org/js.html Karl Rudd On Wed, Oct 1, 2008 at 1:46 AM, ♫ cheskonov <[EMAIL PROTECTED]> wrote: > > hi , > > I am getting this error in Firefox 3.0.2 fire bug console : > > too much recursion /misc/jquery.js Line 2 > > after some searching i found that it may be because of the jason > library used .. > can any one tell me how do i fix it .. > > In IE i got an alert saying that "Stack Overflow at line [line 1]" >
[jQuery] Re: add/remove and recalculate index
its tough to diagnose without knowing what your variable "html" returned by the $.ajax call is but working up an example trying to simulate it, this works as expected items stay in order of adding plus the items adjust their indexes automatically http://paste.pocoo.org/show/86671/ On Sep 30, 5:37 pm, claudes <[EMAIL PROTECTED]> wrote: > i have an interface that allows user to add chapters and remove any chapter > from within the group. i'm having issues re-calculating the sort order. > currently if user adds four chapters (1,2,3,4), removes 2 and adds two more > the order becomes (1, 3,4,2,3). i know i need to so something with index > calculation...but how to is what is confusing me. this is the code that > performs the add remove. > > $("#chapter-append").click(function() { > var chapterCount = new > Number($("#chapter-count").val()); > if (chapterCount <1) chapterCount=0; > chapterCount = chapterCount +1; > $("#chapter-count").val(chapterCount); > > var queryString = > "add-chapter.php?chapter-number="+chapterCount; > //alert(queryString); > $.get(queryString, function(html) { > // append the "ajax'd" data to the table body > $("ol#add-chapter").append(html); > $("ol#add-chapter li > h4").bind('click', function() { > var > newChapter = "#chapter-"+chapterCount+"-container"; > > $(newChapter).remove(); > > chapterCount = chapterCount -1; > > $("#chapter-count").val(chapterCount); > > return false; > }); > $('textarea').autogrow({ > minHeight: 144, lineHeight: 16}); > > $('textarea.for-url').autogrow({ minHeight: 24, lineHeight: 16}); > }); > return false; > }); > > -- > View this message in > context:http://www.nabble.com/add-remove-and-recalculate-index-tp19750882s272... > Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: Selecting nodes using node value within a range
filter() is your friend. You can make a nice little plugin to do this: jQuery.fn.inRange = function( min, max ) { return this.filter( function() { var value = +this.innerHTML; return value >= min && value <= max; }); }; And then you can write code like: var $range = $('#jQueryTestDiv div').inRange( 40, 49 ); -Mike > From: Christoph > > Let's say I have a bunch of DIVs that look like this: > > > 1 > 13 > 34 > 23 > 43 > 12 > 22 > 43 > 232 > 5 > 9 > 99 > 192 > 27 > 47 > 768 > 45 > > > Is there a way I can select only those that have a value that > falls within a range? Using XPath, I would do it using: > > //div[.>13 and .<99] > > but that doesn't work (not surprisingly) nor does any > approximation thereof. Is there any way I can get only those > divs who's value is within a range? > > thnx, > Christoph >
[jQuery] calling jquery cycle function from flash
Hi, I'm using this http://malsup.com/jquery/cycle/ jquery cycle plugin for a slideshow on http://dev.emsix.com/renaissance/default2.asp this page . I have 2 images to rotate in the graphic masthead, each with a flash movie overlay (the yellow text). Instead of having the images cycle automatically, I'd like to call that function from Flash. In other words, I want to dictate when the image should change at a certain point in my flash movie. I'm not sure at all how to do this. I've tried to tuck the cycle code into a new javascript function, and then call that from flash, but no dice. I'm a newbie when it comes to any function-writing, so any help would be much appreciated. Thank you! -- View this message in context: http://www.nabble.com/calling-jquery-cycle-function-from-flash-tp19750565s27240p19750565.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Selecting nodes using node value within a range
Let's say I have a bunch of DIVs that look like this: 1 13 34 23 43 12 22 43 232 5 9 99 192 27 47 768 45 Is there a way I can select only those that have a value that falls within a range? Using XPath, I would do it using: //div[.>13 and .<99] but that doesn't work (not surprisingly) nor does any approximation thereof. Is there any way I can get only those divs who's value is within a range? thnx, Christoph
[jQuery] superfish always using click
I have change this in the code the "hover" to "click" $('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'click'](over,out).each(function() { if (o.autoArrows) addArrow( $('>a:first-child',this) ); }) I want to always use click event to show and to hide. I was trying to daleting "delay". I know that other option is defining delay to "999" but i think its not the better solution. Another thing is the hide event. I would like to change it to another "click". I don't know how to use toogle in this complex (for me) function. Could you help me? thanks!! pd: It would be nice if superfish have this like a parameter.
[jQuery] Exhausted..Need HELP Please! - Jquery / Simplemodal / Jquery.validate.js
Hello, First of all, thank you for reading my post. I have been trying to resolve this issue for the past 2 weeks trying different things. Let me get right into my problem, but before explaining the problem, let me share my objective and then go on from there. Test Link: http://thedailysavings.com/beta/test11.php Objective: Display a lightbox style box containing a registration form. This form must validate all fields in real time using AJAX. There will be other forms on the page as well such as login form or contact us form. What am I using: PHP, Jquery, Jquery form validation plugin (http:// bassistance.de/jquery-plugins/jquery-plugin-validation/), simpleModal lightbox (http://www.ericmmartin.com/projects/simplemodal/). Issue: After many hours of pulling my hair out, I have been able to pinpoint the cause of my problems with this registration form. Here goes: I am able to display the registration form inside the simpleModal lightbox but there are still this issue left. See below some test scenarios: Scenario 1: Validation should happen at all times when using the registration form. a. Open the registration form by clicking on Register Now link. It does validation the first time. TRY entering a wrong email address and you will see proper validation. Now CLOSE the modalBox by clicking on X. b. Open the registration form again by clicking on Register Now Link. Try entering a wrong email address and you will notice that it does NOT perform validation. Scenario 2: Login form (Username & Password inputs) placement impacts the validation of registration form such as: a. If I move the login form above the registration form in the code, the validation stops happening. b. If I move the login form below the registration form (as it is now), the validation works but only the first time. c. If I remove the login form that has Username and Password as inputs, validation works fine. Like I mentioned earlier that I have spent way too much time on this with not enough progress. Maybe because I am new to Jquery and learning it the hard way. Also, please note that this is a stripped down version to show only the registration form in action. I would appreciate so much if you could PLEASE help me get out of this situation and show me the light. Thank you so much Best regards, Azam
[jQuery] Superfish + Mouseout Delay + IE6/7/8
I've got the superfish menus and animation working on the following site: http://beta.adriandominicans.org/ However, the MouseOut delay isn't working on IE6/7/8. It seems that all animations except the MouseOut delay work. Any theories? Thanks, Dave
[jQuery] Re: Adding class to a parent element- traversion help?
@Michael Geary -- Thanks, now I get it. But the code is being output by a CMS, which has some whitespace that is output. So then truncate the whitespace? @FrenchilNLA -- It seemed to make sense, but this didn't work as long as I had that extra space. Once I took out the whitespace that Michael Geary spoke of, it worked. Is there a way to basically have the :empty selector work and ignore whitespace? Thanks from both of you for responding, I really appreciate it.
[jQuery] Re: UI Autocomplete documentation
Documentation: http://docs.jquery.com/Plugins/Autocomplete And it's Jorn's autocomplete plugin that is getting rolled in: http://bassistance.de/jquery-plugins/jquery-plugin-autocomplete/ On Sep 30, 4:57 pm, mario <[EMAIL PROTECTED]> wrote: > Hi, > > Im using the latest UI rc2 and I am going to use the autocomplete that > comes with Jquery UI 1.6, but I can't find any documentation, I read > it was based on a plugin and i think i should use that documentation, > but don't know which autocomplete plugin it is based on. > > Thanks, > Mario
[jQuery] Re: I want to reduce the header calls
lol... sorry After I read through again... I totally missed the java server part... but on the other... I posted in the wrong spot... sorry about that... > I thought you were looking for a way to download your .swf once instead of > starting a bunch of simultaneous downloads for it. that is what I am after here... controlling downloads of componets called by jquery... I think this would be handy for a lot of other things to... well I hope I haven't lost anyone ... :-) need all the help I can get here... thanks again... jeremyBass On Sep 30, 2:12 pm, "Michael Geary" <[EMAIL PROTECTED]> wrote: > I am really lost now. > > I thought you were looking for a way to download your .swf once instead of > starting a bunch of simultaneous downloads for it. > > I don't think a clone of mod_rewrite for Java servers would help you at all. > (Is your server code in Java? Even if it is, it wouldn't help - you're > trying to avoid hitting the server in the first place.) > > Now you found some JavaScript code to detect the user's language. How is > that connected with the download issues? > > (scratching head) > > -Mike > > > > > From: jeremyBass > > > found this... may-be this may help ??? > > > > > if (navigator.browserLanguage){language=navigator.browserLanguage} > > if (navigator.userLanguage){language=navigator.userLanguage} > > if (navigator.systemLanguage){language=navigator.systemLanguage} > > if (navigator.language){language=navigator.language} > > if (language.indexOf('-')==2) {language=language.substring(0,2);} > > if (language=='en') { document.write("Hello there!"); } > > else if (language=='jp') { document.write("Konichiwa!"); } > > else if (language=='fr') { document.write("Bonjour!"); } > > > On Sep 30, 9:47 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > So I think this is the ticket... but I really am not to sure on the > > > how yet... > > > >http://code.google.com/p/urlrewritefilter/ > > > > anyone have a sec to help me out with this? thank you jeremyBass > > > > On Sep 29, 7:37 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > I new that was to good to be true... well moving on to a > > new view > > > > There has to be a way to "capture" the HTTP requests ... I think > > > > I've seen URL rewrites with javascript... so may-be I > > could have it > > > > so that it's more like this... if HTPP request is in > > array die else > > > > execute and push URL to array? any ideas on that? > > > > > thanks for the help... > > > > jeremyBass > > > > > On Sep 29, 4:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > Oops, sorry, what I meant is that cloning the elements > > is the best > > > > > optimization you can do. It will save you some processing time > > > > > from not creating new elements (or maybe not, as jQuery will be > > > > > re-creating the clone element), but the HTTP requests > > will remain. > > > > > > $('#flash-round-corner- > > > thing').clone().appendTo('newcorner').clone().appendTo('anothercor > > > > > ner') > > > > > etc. > > > > > > On Sep 29, 1:08 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > Thank you for the help... > > > > > > > >>> And using dozens of flash objects to round > > corners doesn't > > > > > > >>> seem like a good idea... > > > > > > > Yeah I thought there would be alot of trouble to at > > first... but > > > > > > it's better then cornflex and jcorner altogether... it's > > > > > > absolutely working perfectly. the 10-12 calls are on > > the first > > > > > > download only and it's not the round boxes... it's mostly the > > > > > > srif anyways... but that's ok... I'm just being anal > > and trying > > > > > > to work out everything before I share this with > > everyone. right > > > > > > now the round box mod is total 1kb big if you already have > > > > > > jflash.js. And it's... well I'll share this all in > > bit... I want to protect it and have never done that before... > > > > > > like a gpl? or something... anyways... > > > > > > > >>> If the element is already being cloned instead of being > > > > > > >>> created again, > > > > > > >>> there is no fix. > > > > > > > so if they aren't? I could reuse the element with > > the new vars? > > > > > > then I would only have made one call as long as I > > don't change > > > > > > the source... smashing! now how to write that... :-) > > any more > > > > > > ideas on this? > > > > > > > thanks for the help... > > > > > > jeremyBass > > > > > > > On Sep 28, 8:31 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > > > If the element is already being cloned instead of being > > > > > > > created again, there is no fix. You can > > > > > > > create/clone/append/modify an image or object tag, > > but it will always need to request it's content from the server. > > > > > > > And using dozens of flash objects to round corners doesn't > > > > > > > seem like a good idea... > > > > > > > > On Sep 28, 6:14 pm, jeremyBass > > <[EMAIL PROTECTED]> wrote: > > > > > > > > > I'm so it is be c
[jQuery] Re: Setting the selected item in a combo box
Ricardo, I am a bit new at using jQuery so this could be an inane question: Is the 'select' applied at the selector? If my control's id is emplist would the correct syntax be: $('#emplist select').val(empSelected); empSelected, in this case, is a variable containing the value I want to set the 'selected' attribute for. This page is a template rendered by a server call and the server sets the value of each of the fields of the form. But I want each field to have the values that can be selected. The complete code is: // Load the list using Ajax and Json: $('#emplist').loadList(getEmpListURL, '#emplist'); // Then set the value of the selected option $('#emplist select').val(empSelected); The list is populated but the option value is not set to 'selected' On Sep 29, 5:27 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > $('select').val('value') should work (it needs to be applied to the > , not the > > - ricardo > > On Sep 29, 6:55 pm, Pete <[EMAIL PROTECTED]> wrote: > > > I have an element that I populate with an Ajax call and returns a list > > of items for a combo box. In some cases the page containing the > > element gets loaded with existing values and rendered and I'd like the > > textbox to contain an item that was selected before the element is > > rendered. > > > Is there a way to set that value? I have done some searching but > > haven't found a solution as yet. I have looked at setting the > > "selected" attribute but haven't found an example that works. I have > > also tried setting the selected value with .val(myValue); but, again, > > tried it and didn't get it to work. > > > It should be simple. But I can't seem to crack it. Suggestions? > > > Thanks, > > > Pete
[jQuery] Re: Adding class to a parent element- traversion help?
your problem is coming from (this). just try : $(".bc-wrapper:empty").parent().addClass("none"); On Sep 30, 2:09 pm, Vinoj <[EMAIL PROTECTED]> wrote: > I've got the following as my jquery code: > > $(document).ready(function() { > $(".bc-wrapper:empty").(this).parent().addClass("none"); > }); > > > > And the html is: > > > > > > > > The css is as follows: > .bottom-content { > display: block; > width: 215px; > border: 1px solid #ccc; > float: left; > margin-right: 20px; > } > .bc-wrapper { > padding: 5px; > } > .none { > visibility: hidden; > border: none; > } > > -- > Basically in this example, I'd like the bottom-content class to be > hidden if the bc-wrapper class has no content. Unfortunately, I > believe I've written my code wrong (in all the different variations > I've tried) for jQuery because nothing is happening. Even when I check > with Firebug, there's no class attached anywhere. > > Any thoughts?
[jQuery] Re: select data in a ignoring the
Dear folks , finally this is what I got $(p).each(function(){ if(this.childNodes[0].nodeName.toLowerCase() !="span") var newNode=$(this.childNodes[0]).wrap(""); newNode.css('color','red'); }); this is the shortest code , basically you can not treat as a SELECTOR to a Text which is not in the Tag so everything goes Wrong Unless be get the text with the jQuery and then Wrap it with a Tag after that it is ready to do what ever We want if make it workable in this 3 Line 1- all P has been Filter 2- all Children which are not in the Span are FIlter RIght now we can not do something like this $(.).css(...) ; because our Text is not a Selecter so 3- we Wrap it with what ever we want and now it is ready for you to work with it thanks a Lot Equally... and other Guys basically we could not work with a text which is not Wrapped in a Tag ... On Sep 30, 11:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > Here's a better version of > that:http://joeflateau.net/playground/testingpexcspan2.html > > $( function(){ > console.log($($ > ("p").childNodesExclusive("span")).allDOMNodesToHTML()); > > }); > > // this function returns all child nodes for the given element, > excluding those that have a property that matches > jQuery.fn.childNodesExclusive = function(exclude, caseSensitive, > DOMProperty) { > DOMProperty = DOMProperty || "nodeName"; > caseSensitive = (typeof caseSensitive != 'undefined') ? > caseSensitive : false; > > exclude = (!caseSensitive) ? exclude.toLowerCase() : exclude; > > var nodes = []; > > $(this).each( function() { > $.each(this.childNodes, function(i, node) { > var compare = (!caseSensitive) ? > node[DOMProperty].toLowerCase() : > node[DOMProperty]; > if (exclude != compare) { nodes[nodes.length] = node; > } > }); > }); > > return nodes; > > } > > // this function converts all nodes to html, including text nodes > // and ignoring invisible nodes > jQuery.fn.allDOMNodesToHTML = function() { > var valueTypeNodes = [ > document.TEXT_NODE, > document.ATTRIBUTE_NODE, > document.CDATA_SECTION_NODE > ] > var ignoreNodes = [ > document.PROCESSING_INSTRUCTION_NODE, > document.COMMENT_NODE > ] > > var html = ""; > > this.each( function(i, node){ > if ($.inArray(node.nodeType, ignoreNodes) > -1) { > //do nothing > } else if ($.inArray(node.nodeType, valueTypeNodes) > -1) { > html += node.nodeValue; > } else { > html += node.innerHtml; > } > }); > > return html; > > } > > On Sep 30, 3:01 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > NodeType Named Constant > > 1 ELEMENT_NODE > > 2 ATTRIBUTE_NODE > > 3 TEXT_NODE > > 4 CDATA_SECTION_NODE > > 5 ENTITY_REFERENCE_NODE > > 6 ENTITY_NODE > > 7 PROCESSING_INSTRUCTION_NODE > > 8 COMMENT_NODE > > 9 DOCUMENT_NODE > > 10 DOCUMENT_TYPE_NODE > > 11 DOCUMENT_FRAGMENT_NODE > > 12 NOTATION_NODE > > > from:http://www.w3schools.com/Dom/dom_nodetype.asp > > > I had to check for nodeType == 3 since the text nodes do not have an > > innerHtml property. Also, after some reading, I think 'node.nodeValue' > > would be more "proper" over 'node.data' > > > I'd like to see how you get it to work better with jQuery, or rather, > > "native jQuery". I'll try it myself, but I'd like to see how others > > would implement it. > > > On Sep 30, 2:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > > > > Wow amazing... it worked let me ask you question I think I can do it > > > with jQuery .. > > > do you know what does node.nodeType mean in javascript > > > nodeType=1 what does that mean for each value ? > > > thanks Pedram > > > > On Sep 30, 8:29 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > I'm not sure how to do it in a "jQuery" way. But here's what I came up > > > > with: > > > > > $( function(){ > > > > $("p").each( function() { > > > > var allButSpan = this.allButSpan = new Array(); > > > > $.each(this.childNodes, function(i, node) { > > > > if (node.nodeName.toLowerCase() != "span") > > > > { allButSpan[allButSpan.length] = node; } > > > > }); > > > > }); > > > > > $("p").each( function(){ > > > > var innerHtml = ""; > > > > $.each(this.allButSpan, function(i, node) { innerHtml += > > > > (node.nodeType == 3) ? node.data : $(node).html(); } ); > > > > console.log(innerHtml); > > > > }); > > > > > }); > > > > > Example here:http://joeflateau.net/playground/testingpexcspan.html > > > > > You n
[jQuery] Trouble serializing a form
Hi, I have a form on my page with id="bindingForm" and name="bindingForm". I am using the latest version of JQuery 1.2.6. I am trying to serialize a form like so var paramStr = $('#' + formId).serialize(); where formId contains the value "bindingForm". Unfortunately, "paramStr" contains the value "undefined" afterwards. Any advice on where I'm going wrong? Thanks, - Dave
[jQuery] Re: Adding class to a parent element- traversion help?
Your div.bc-wrapper isn't empty. It has a text node in it because of the whitespace. Open Firebug on any page that uses jQuery and switch it to the multiline console (orange up arrow at the bottom right). Then paste this code in, hit Ctrl+Enter, and observe the results: $a = $('' ); $b = $(' ' ); console.log( $a.find('div.wrapper:empty') ); console.log( $b.find('div.wrapper:empty') ); -Mike > From: Vinoj > Sent: Tuesday, September 30, 2008 2:10 PM > > I've got the following as my jquery code: > > $(document).ready(function() { > $(".bc-wrapper:empty").(this).parent().addClass("none"); > }); > > > > And the html is: > > > > > > > > The css is as follows: > .bottom-content { > display: block; > width: 215px; > border: 1px solid #ccc; > float: left; > margin-right: 20px; > } > .bc-wrapper { > padding: 5px; > } > .none { > visibility: hidden; > border: none; > } > > -- > Basically in this example, I'd like the bottom-content class > to be hidden if the bc-wrapper class has no content. > Unfortunately, I believe I've written my code wrong (in all > the different variations I've tried) for jQuery because > nothing is happening. Even when I check with Firebug, there's > no class attached anywhere. > > Any thoughts? >
[jQuery] add/remove and recalculate index
i have an interface that allows user to add chapters and remove any chapter from within the group. i'm having issues re-calculating the sort order. currently if user adds four chapters (1,2,3,4), removes 2 and adds two more the order becomes (1, 3,4,2,3). i know i need to so something with index calculation...but how to is what is confusing me. this is the code that performs the add remove. $("#chapter-append").click(function() { var chapterCount = new Number($("#chapter-count").val()); if (chapterCount <1) chapterCount=0; chapterCount = chapterCount +1; $("#chapter-count").val(chapterCount); var queryString = "add-chapter.php?chapter-number="+chapterCount; //alert(queryString); $.get(queryString, function(html) { // append the "ajax'd" data to the table body $("ol#add-chapter").append(html); $("ol#add-chapter li h4").bind('click', function() { var newChapter = "#chapter-"+chapterCount+"-container"; $(newChapter).remove(); chapterCount = chapterCount -1; $("#chapter-count").val(chapterCount); return false; }); $('textarea').autogrow({ minHeight: 144, lineHeight: 16}); $('textarea.for-url').autogrow({ minHeight: 24, lineHeight: 16}); }); return false; }); -- View this message in context: http://www.nabble.com/add-remove-and-recalculate-index-tp19750882s27240p19750882.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: prevent tab changing + user message
You could try this: always return false in the select handler (basically prevent tab switching), remember the clicked tab and if the user says "Yes" activate the tab manually (untested, I may have messed up parentheses): var TabSolicitud = $('#SolicitudAguaTabContainer > ul').tabs({ select: function(e, ui) { $("#InfoDialog").html("Do you want to save changes?"); $("#InfoDialog").dialog({ ... buttons: { "Yes": function() { $(this).dialog("close"); SaveChanges(); TabSolicitud.tabs('select', ui.index); }, "NO": function() { $(this).dialog("close"); } } }); return false; } }); If ui.index doesn't work for - it has been added not too long ago - you can just use ui.panel.id instead. --Klaus On 30 Sep., 19:03, oscarml <[EMAIL PROTECTED]> wrote: > Hi. Nobody can help me with this issue? > > I don´t know if is crearly enough: > > On the select propertie of the tab I call a function. This works great > with validation plugin, due to it returns true or false without user > action. the problem is when I present a dialog to the user in order to > determine weather to return true or false. when I launch the dialog, > it returns true to the select tab event, so despite the dialog launchs > and wait for user choice, the tab has already changed. > > thanks > > On 14 sep, 11:51, oscarml <[EMAIL PROTECTED]> wrote: > > > Hi klaus, > > > I had already read the FAQ, and as you can see in my code I'm using > > the select property. This works fine for example if you run a function > > that returns true or false without asking user anything, but in my > > case I need the user to choose one option. Then, when I offer the > > dialog box, the code inside the 'select' property is returning true, > > before the user press a button. > > > Any idea? > > > On 1 sep, 06:18, Klaus Hartl <[EMAIL PROTECTED]> wrote: > > > > See > > > FAQ:http://docs.jquery.com/UI/Tabs#...prevent_switching_to_the_tab_on_cli... > > > > --Klaus > > > > On Aug 31, 5:23 pm,oscarml<[EMAIL PROTECTED]> wrote: > > > > > Hi to everybody, > > > > > I'm trying to control tab switching depending on user answer to a > > > > dialog. Here is my code; > > > > > var TabSolicitud = $('#SolicitudAguaTabContainer > ul').tabs({ > > > > select: function(e, ui){ > > > > $("#InfoDialog").html("Do you want to save > > > > changes?"); > > > > $("#InfoDialog").dialog({ > > > > modal: true, > > > > addClass: 'ModalInfo', > > > > resizable: false, > > > > title: " > > > src='imagenes/messagebox_info.png' class='img_title' /> ", > > > > > overlay: { > > > > opacity: 0.5, > > > > background: "black" > > > > }, > > > > buttons: { > > > > "Yes": function() { > > > > > > > > $(this).dialog("close"); > > > > SaveChanges(); > > > > }, > > > > "NO": function() { > > > > > > > > $(this).dialog("close"); > > > > return false; > > > > } > > > > > }); > > > > > The problem is that when I show the dialog, the tab switched to the > > > > selected one. It doesn´t wait until it knows the answer of the user. > > > > > What could I do?
[jQuery] Re: Ajax Tabs and jqModal
on 9/30/08 2:03 PM, Klaus Hartl at [EMAIL PROTECTED] wrote: > > On 30 Sep., 18:25, "Steffan A. Cline" <[EMAIL PROTECTED]> wrote: >> Thanks for the quick answer! I did realize that the issue was that the items >> did not exist at the time of binding. I am new to jQuery and am trying to >> understand all the nice amenities we have now in comparison to hand coding >> all of this. >> >> I tried to implement your example as a drop in and it seemed to make no >> difference. Was there supposed to be more for me to add? > > Yes there was... :) > > The line where you initialize the dialog must be repeated in the load > callback. Theoretically that is, because I'm not sure how the jqModel > plugin works. But I just learned that you can safely reinitialize a > modal, thus the following code should work (albeit untested): > > $(function() { > > var dialogify = function() { > $('#dialog').jqm({ajax: '@href', trigger: 'a.details'}); > }; > dialogify(); > > $('#tabs > ul').tabs({ > load: dialogify, > fx: { height: 'toggle', opacity: 'toggle' } > }); > > }); > > HTH --Klaus No dice. It does not even bind at all now. Not sure why. I'll have to play around with some more. Any other ideas? I'll see if I can find a way to post an example. Problem is the live data. :( Thanks Steffan --- T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4 Steffan A. Cline [EMAIL PROTECTED] Phoenix, Az http://www.ExecuChoice.net USA AIM : SteffanC ICQ : 57234309 YAHOO : Steffan_Cline MSN : [EMAIL PROTECTED] GOOGLE: Steffan.Cline Lasso Partner Alliance Member ---
[jQuery] Re: I want to reduce the header calls
I am really lost now. I thought you were looking for a way to download your .swf once instead of starting a bunch of simultaneous downloads for it. I don't think a clone of mod_rewrite for Java servers would help you at all. (Is your server code in Java? Even if it is, it wouldn't help - you're trying to avoid hitting the server in the first place.) Now you found some JavaScript code to detect the user's language. How is that connected with the download issues? (scratching head) -Mike > From: jeremyBass > > found this... may-be this may help ??? > > > if (navigator.browserLanguage){language=navigator.browserLanguage} > if (navigator.userLanguage){language=navigator.userLanguage} > if (navigator.systemLanguage){language=navigator.systemLanguage} > if (navigator.language){language=navigator.language} > if (language.indexOf('-')==2) {language=language.substring(0,2);} > if (language=='en') { document.write("Hello there!"); } > else if (language=='jp') { document.write("Konichiwa!"); } > else if (language=='fr') { document.write("Bonjour!"); } > > > > On Sep 30, 9:47 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > So I think this is the ticket... but I really am not to sure on the > > how yet... > > > > http://code.google.com/p/urlrewritefilter/ > > > > anyone have a sec to help me out with this? thank you jeremyBass > > > > On Sep 29, 7:37 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > > > I new that was to good to be true... well moving on to a > new view > > > There has to be a way to "capture" the HTTP requests ... I think > > > I've seen URL rewrites with javascript... so may-be I > could have it > > > so that it's more like this... if HTPP request is in > array die else > > > execute and push URL to array? any ideas on that? > > > > > thanks for the help... > > > jeremyBass > > > > > On Sep 29, 4:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > Oops, sorry, what I meant is that cloning the elements > is the best > > > > optimization you can do. It will save you some processing time > > > > from not creating new elements (or maybe not, as jQuery will be > > > > re-creating the clone element), but the HTTP requests > will remain. > > > > > > $('#flash-round-corner- > > > > > thing').clone().appendTo('newcorner').clone().appendTo('anothercor > > > > ner') > > > > etc. > > > > > > On Sep 29, 1:08 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > Thank you for the help... > > > > > > > >>> And using dozens of flash objects to round > corners doesn't > > > > > >>> seem like a good idea... > > > > > > > Yeah I thought there would be alot of trouble to at > first... but > > > > > it's better then cornflex and jcorner altogether... it's > > > > > absolutely working perfectly. the 10-12 calls are on > the first > > > > > download only and it's not the round boxes... it's mostly the > > > > > srif anyways... but that's ok... I'm just being anal > and trying > > > > > to work out everything before I share this with > everyone. right > > > > > now the round box mod is total 1kb big if you already have > > > > > jflash.js. And it's... well I'll share this all in > bit... I want to protect it and have never done that before... > > > > > like a gpl? or something... anyways... > > > > > > > >>> If the element is already being cloned instead of being > > > > > >>> created again, > > > > > >>> there is no fix. > > > > > > > so if they aren't? I could reuse the element with > the new vars? > > > > > then I would only have made one call as long as I > don't change > > > > > the source... smashing! now how to write that... :-) > any more > > > > > ideas on this? > > > > > > > thanks for the help... > > > > > jeremyBass > > > > > > > On Sep 28, 8:31 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > > > If the element is already being cloned instead of being > > > > > > created again, there is no fix. You can > > > > > > create/clone/append/modify an image or object tag, > but it will always need to request it's content from the server. > > > > > > And using dozens of flash objects to round corners doesn't > > > > > > seem like a good idea... > > > > > > > > On Sep 28, 6:14 pm, jeremyBass > <[EMAIL PROTECTED]> wrote: > > > > > > > > > I'm so it is be cahced but the HTTP requests on the dead > > > > > > > download is still high... I'm not sure how to stop it frm > > > > > > > makeing the requests sice the first time it runs > through the > > > > > > > functions it has downloaded the swf so no need to > make a new HTTP request... any ideas on this? > > > > > > > > > On Sep 28, 10:56 am, jeremyBass > <[EMAIL PROTECTED]> wrote: > > > > > > > > > > Does anyone have an idea on this... or , and I don't do > > > > > > > > this well and lot lol, but am I not being > clear? I really > > > > > > > > need to figure this out... Thanks jeremyBass > > > > > > > > > > On Sep 27, 3:21 pm, jeremyBass > <[EMAIL PROTECTED]> wrote: > >
[jQuery] Adding class to a parent element- traversion help?
I've got the following as my jquery code: $(document).ready(function() { $(".bc-wrapper:empty").(this).parent().addClass("none"); }); And the html is: The css is as follows: .bottom-content { display: block; width: 215px; border: 1px solid #ccc; float: left; margin-right: 20px; } .bc-wrapper { padding: 5px; } .none { visibility: hidden; border: none; } -- Basically in this example, I'd like the bottom-content class to be hidden if the bc-wrapper class has no content. Unfortunately, I believe I've written my code wrong (in all the different variations I've tried) for jQuery because nothing is happening. Even when I check with Firebug, there's no class attached anywhere. Any thoughts?
[jQuery] Re: Ajax Tabs and jqModal
On 30 Sep., 18:25, "Steffan A. Cline" <[EMAIL PROTECTED]> wrote: > Thanks for the quick answer! I did realize that the issue was that the items > did not exist at the time of binding. I am new to jQuery and am trying to > understand all the nice amenities we have now in comparison to hand coding > all of this. > > I tried to implement your example as a drop in and it seemed to make no > difference. Was there supposed to be more for me to add? Yes there was... :) The line where you initialize the dialog must be repeated in the load callback. Theoretically that is, because I'm not sure how the jqModel plugin works. But I just learned that you can safely reinitialize a modal, thus the following code should work (albeit untested): $(function() { var dialogify = function() { $('#dialog').jqm({ajax: '@href', trigger: 'a.details'}); }; dialogify(); $('#tabs > ul').tabs({ load: dialogify, fx: { height: 'toggle', opacity: 'toggle' } }); }); HTH --Klaus
[jQuery] UI Autocomplete documentation
Hi, Im using the latest UI rc2 and I am going to use the autocomplete that comes with Jquery UI 1.6, but I can't find any documentation, I read it was based on a plugin and i think i should use that documentation, but don't know which autocomplete plugin it is based on. Thanks, Mario
[jQuery] Re: select data in a ignoring the
If you are 100% sure that the will always come AFTER the text data, like your example format, you could simply do: $('#paragraph')[0].childNodes[0]; or $('p').each(function(){ var data = this.childNodes[0]; }); - ricardo On Sep 30, 5:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > Here's a better version of > that:http://joeflateau.net/playground/testingpexcspan2.html > > $( function(){ > console.log($($ > ("p").childNodesExclusive("span")).allDOMNodesToHTML()); > > }); > > // this function returns all child nodes for the given element, > excluding those that have a property that matches > jQuery.fn.childNodesExclusive = function(exclude, caseSensitive, > DOMProperty) { > DOMProperty = DOMProperty || "nodeName"; > caseSensitive = (typeof caseSensitive != 'undefined') ? > caseSensitive : false; > > exclude = (!caseSensitive) ? exclude.toLowerCase() : exclude; > > var nodes = []; > > $(this).each( function() { > $.each(this.childNodes, function(i, node) { > var compare = (!caseSensitive) ? > node[DOMProperty].toLowerCase() : > node[DOMProperty]; > if (exclude != compare) { nodes[nodes.length] = node; > } > }); > }); > > return nodes; > > } > > // this function converts all nodes to html, including text nodes > // and ignoring invisible nodes > jQuery.fn.allDOMNodesToHTML = function() { > var valueTypeNodes = [ > document.TEXT_NODE, > document.ATTRIBUTE_NODE, > document.CDATA_SECTION_NODE > ] > var ignoreNodes = [ > document.PROCESSING_INSTRUCTION_NODE, > document.COMMENT_NODE > ] > > var html = ""; > > this.each( function(i, node){ > if ($.inArray(node.nodeType, ignoreNodes) > -1) { > //do nothing > } else if ($.inArray(node.nodeType, valueTypeNodes) > -1) { > html += node.nodeValue; > } else { > html += node.innerHtml; > } > }); > > return html; > > } > > On Sep 30, 3:01 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > NodeType Named Constant > > 1 ELEMENT_NODE > > 2 ATTRIBUTE_NODE > > 3 TEXT_NODE > > 4 CDATA_SECTION_NODE > > 5 ENTITY_REFERENCE_NODE > > 6 ENTITY_NODE > > 7 PROCESSING_INSTRUCTION_NODE > > 8 COMMENT_NODE > > 9 DOCUMENT_NODE > > 10 DOCUMENT_TYPE_NODE > > 11 DOCUMENT_FRAGMENT_NODE > > 12 NOTATION_NODE > > > from:http://www.w3schools.com/Dom/dom_nodetype.asp > > > I had to check for nodeType == 3 since the text nodes do not have an > > innerHtml property. Also, after some reading, I think 'node.nodeValue' > > would be more "proper" over 'node.data' > > > I'd like to see how you get it to work better with jQuery, or rather, > > "native jQuery". I'll try it myself, but I'd like to see how others > > would implement it. > > > On Sep 30, 2:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > > > > Wow amazing... it worked let me ask you question I think I can do it > > > with jQuery .. > > > do you know what does node.nodeType mean in javascript > > > nodeType=1 what does that mean for each value ? > > > thanks Pedram >
[jQuery] Re: select data in a ignoring the
Here's a better version of that: http://joeflateau.net/playground/testingpexcspan2.html $( function(){ console.log($($ ("p").childNodesExclusive("span")).allDOMNodesToHTML()); }); // this function returns all child nodes for the given element, excluding those that have a property that matches jQuery.fn.childNodesExclusive = function(exclude, caseSensitive, DOMProperty) { DOMProperty = DOMProperty || "nodeName"; caseSensitive = (typeof caseSensitive != 'undefined') ? caseSensitive : false; exclude = (!caseSensitive) ? exclude.toLowerCase() : exclude; var nodes = []; $(this).each( function() { $.each(this.childNodes, function(i, node) { var compare = (!caseSensitive) ? node[DOMProperty].toLowerCase() : node[DOMProperty]; if (exclude != compare) { nodes[nodes.length] = node; } }); }); return nodes; } // this function converts all nodes to html, including text nodes // and ignoring invisible nodes jQuery.fn.allDOMNodesToHTML = function() { var valueTypeNodes = [ document.TEXT_NODE, document.ATTRIBUTE_NODE, document.CDATA_SECTION_NODE ] var ignoreNodes = [ document.PROCESSING_INSTRUCTION_NODE, document.COMMENT_NODE ] var html = ""; this.each( function(i, node){ if ($.inArray(node.nodeType, ignoreNodes) > -1) { //do nothing } else if ($.inArray(node.nodeType, valueTypeNodes) > -1) { html += node.nodeValue; } else { html += node.innerHtml; } }); return html; } On Sep 30, 3:01 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > NodeType Named Constant > 1 ELEMENT_NODE > 2 ATTRIBUTE_NODE > 3 TEXT_NODE > 4 CDATA_SECTION_NODE > 5 ENTITY_REFERENCE_NODE > 6 ENTITY_NODE > 7 PROCESSING_INSTRUCTION_NODE > 8 COMMENT_NODE > 9 DOCUMENT_NODE > 10 DOCUMENT_TYPE_NODE > 11 DOCUMENT_FRAGMENT_NODE > 12 NOTATION_NODE > > from:http://www.w3schools.com/Dom/dom_nodetype.asp > > I had to check for nodeType == 3 since the text nodes do not have an > innerHtml property. Also, after some reading, I think 'node.nodeValue' > would be more "proper" over 'node.data' > > I'd like to see how you get it to work better with jQuery, or rather, > "native jQuery". I'll try it myself, but I'd like to see how others > would implement it. > > On Sep 30, 2:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > > > Wow amazing... it worked let me ask you question I think I can do it > > with jQuery .. > > do you know what does node.nodeType mean in javascript > > nodeType=1 what does that mean for each value ? > > thanks Pedram > > > On Sep 30, 8:29 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > I'm not sure how to do it in a "jQuery" way. But here's what I came up > > > with: > > > > $( function(){ > > > $("p").each( function() { > > > var allButSpan = this.allButSpan = new Array(); > > > $.each(this.childNodes, function(i, node) { > > > if (node.nodeName.toLowerCase() != "span") > > > { allButSpan[allButSpan.length] = node; } > > > }); > > > }); > > > > $("p").each( function(){ > > > var innerHtml = ""; > > > $.each(this.allButSpan, function(i, node) { innerHtml += > > > (node.nodeType == 3) ? node.data : $(node).html(); } ); > > > console.log(innerHtml); > > > }); > > > > }); > > > > Example here:http://joeflateau.net/playground/testingpexcspan.html > > > > You need Firebug (or anything that supports console.log) to use the > > > example! > > > > On Sep 30, 12:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > > > > > It didn't work Cause the Text isn't concern as a Children and it is in > > > > No Tag area so when we call $(this).children it returns only the > > > > Span and if we do $(this).children(":not(span)") it returns NULL ... > > > > so Equally. what should we do > > > > > On Sep 30, 5:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > Ok, how about something to the effect of: > > > > > > $("p").each(function() { $ > > > > > (this).children(":not(span)").css({color:"red"}); }); > > > > > > On Sep 30, 8:12 am, [EMAIL PROTECTED] wrote: > > > > > > > If I do this with CLone then all my prossesing is with the clone > > > > > > but I > > > > > > need to have a selector in the Original one not in the Clone so > > > > > > changing and modifying the clone is not necessary ,the only way is > > > > > > get > > > > > > a Clone of THe Span Then Remove the Span and then get the content of > > > > > > the P do some changes on it , after that add the Span again And I > > > > > > think this is not th
[jQuery] Tablesorter pager refresh pager
I am trying to update the tablesorter pager whenever I dynamically add or delete a row from the table. So far I'm using tips from this post, http://www.nabble.com/Add-row-and-refresh-tablesorter-with-pager.-td13236775s27240.html#a13236775 I am able to update the table and re-sort when a new row is added, but whenever I delete a row, it sorts, but it fails to show the correct # of rows. For example, if I have 16 rows, with a pager showing 15 per page, and I delete a row dynamically, then my page will show 14 rows on page 1, and 1 row on page 2. I'm caling this after add/delete: $("#myTable").trigger("update"); $("#myTable").trigger("appendCache"); $("#myTable.tablesorter").get(0).config.sortList; $("#myTable").trigger("sorton", [config.sortList]); which updates the tablesorter, and works perfectly with the pager on add. If I include the calls to the pager, before and after update like the post above says, adding will also fail. -- View this message in context: http://www.nabble.com/Tablesorter-pager-refresh-pager-tp19748007s27240p19748007.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Re: stripping style from ajax html
Hi Prajwala, Well that kind of worked. I ended up doing this: data = $(data); var replace = $(''); data.each( function() { if ( this.tagName != 'STYLE' && this.tagName != 'SCRIPT' && this.tagName != 'COMMENT' ) { replace.append( this ); } } ); I could not get the remove() function to behave as expected. Perhaps I need to remove all children tags first or something like that? Anyway this got me the desired results! Thanks! cRRRum On Sep 30, 12:47 am, "Prajwala Manchikatla" <[EMAIL PROTECTED]> wrote: > I tested with this html > t = > $('.s{color:red}function(){alert("hi")}') > > The return value is jquery object with 3 elements. > when I do t.get(0) it return style tag > when I do t.get(1) it return script tag > when I do t.get(2) it return just "" the content of the body tag > > So what happened is the jquery did not consider the html, head, body tags. > It just created style, script and the content of the body tag with the text > element. > > so you can do like this > t.each(function(){ > if (this.tagName == 'STYLE'){ > $(this).remove(); > return; > } > if(this.tagName == 'SCRIPT'){ >$(this).remove(); > } > > }) > > so it will remove the style and script tags. > > cheers, > Prajwala > > On Mon, Sep 29, 2008 at 11:24 PM, crrrum <[EMAIL PROTECTED]> wrote: > > > Hello all, > > > I have a webapp displaying email which can sometimes contain HTML > > message bodies. I use jquery's .ajax method to grab an HTML message > > body and then put it into a div tag. Problem is if the HMTL contains > > style or script tags I get unwanted results. > > > I've tried $( html ).find( 'style' ).remove(). This will remove the > > the actual and tags but still leaves the style text > > itself inside. I tried several variations but I just can't seem to > > get this to remove the actual style text with the style tags. Any way > > to do this or will I have to do a bunch of custom search and replaces? > > > Thanks in advance, > > cRRRum
[jQuery] Re: cite jquery
Thanks. I also plan to publish in an article in a scientific journal. Is there an official publication for JQuery I can cite? Or do I just site it by URL? Vince On Sep 29, 3:11 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Footer link would probably be nice, or a "credits" page in the footer, or > even in your source code. > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of forgetta > Sent: Monday, September 29, 2008 10:16 AM > To: jQuery (English) > Subject: [jQuery] cite jquery > > Hi all, > > I am using JQuery in a web application I plan to publish. How do I cite > JQuery? > > Thanks. > > Vince
[jQuery] Re: cite jquery
Thanks. I also plan to publish in an article in a scientific journal. Is there an official publication for JQuery I can cite? Or do I just site it by URL? Vince On Sep 29, 3:11 pm, "Andy Matthews" <[EMAIL PROTECTED]> wrote: > Footer link would probably be nice, or a "credits" page in the footer, or > even in your source code. > > -Original Message- > From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On > > Behalf Of forgetta > Sent: Monday, September 29, 2008 10:16 AM > To: jQuery (English) > Subject: [jQuery] cite jquery > > Hi all, > > I am using JQuery in a web application I plan to publish. How do I cite > JQuery? > > Thanks. > > Vince
[jQuery] Re: Set height of element depending on only on its own position and window height?
Thanks for your input, your demo is actually working better than what I came up with, I'm gonna look into it and see if I can use it. Absolute positioning would normally work but not in my case. This function is to be a part in a web based user interface for a very large business application, and the html framework includes a gazillion positioned elements to make the app stretch to the whole viewport, and it has a collapsible left search and menu section, so absolute positioning would mess with a lot of other stuff... This is actually a holder for a search result table, where the table header is fixed and the body is scrolling, and I cannot set any heights or widths manually. Widths do themselves pretty good, but in order to get a pixel hiehgt value that would go from the start of the table and take up the rest of the viewport, this is the way to go. I'm also setting the table width to the div's auto width minus 20px to accommodate for the scrollbar. Also, I use a similar function for Firefox, but since firefox scrolls the tbody element nicely if you set it to a fixed height, I target that instead. And since FF stretches the tbody to this fixed height even if there's too few rows, I have to compare the actual height with: $("tbody").height() with the full viewport height which is window height minus top offset minus thead height and a bogus tfoot div height and 20px bottom spacer. Which ever is the lowest vaule is applied to the tbody, works like a charm :-)) All left now is the left search/menu collapse coltroller for this and Im all set. Thanks again for your help! /Torgil - kabelkultur.se On 30 Sep, 21:06, rolfsf <[EMAIL PROTECTED]> wrote: > I might add that you may be able to accomplish the same thing in > 'modern' browsers (e.g. not IE6) with just css, using absolute > positioning. Just set your right, left and bottom to, for example, > 10px. (IE6 can't handle positioning on 3 sides). > > On Sep 30, 11:58 am, rolfsf <[EMAIL PROTECTED]> wrote: > > > > > Glad you solved it. I actually had a mistake in my last line, but > > here's a working version: > > >http://www.monkeypuzzle.net/testfiles/jquery/divSize.htm > > > I added a window resize function so it always adapts to the window. As > > you can see, nothing is absolutely positioned, and I threw a mixture > > of elements above the div I wanted to size, just to confirm that it > > really doesn't care what's there - it's measuring the offset from the > > top of the window. > > > On Sep 30, 3:26 am, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > > > > Well, I managed to solve it. > > > > Using option relativeTo for the offset and setting the relativeTo to > > > use my header div that is always present, and always absolutely > > > positioned at top:0; > > > > Now I have a div that takes up whatever space is left down to bottom > > > of viewport, just like I wanted. Thanks for all help! > > > > On 30 Sep, 10:18, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > > > > > Well, thanks, but it turns out that it does exactly the same as my own > > > > function. > > > > If I have a div above it with a SET TOP position, e.g. css: top:0; - > > > > or whatever - it works. > > > > But if I don't have nothing but a bunch of tags above the div, > > > > or if I set the div above to psition:relative and remove the set top > > > > position, it doesn't work anymore. > > > > I really need some way to get the top offset for my div from the top > > > > edge of the window, no matter what may or may not be above the div in > > > > the DOM tree, and so far no luck. > > > > But thanks for the effort, I appreciate it. > > > > > /Torgil > > > > > On 29 Sep, 21:26, rolfsf <[EMAIL PROTECTED]> wrote: > > > > > > try this: > > > > > > var wh = $(window).height(); // window > > > > > height > > > > > var mt = $('#myDiv').offset().top; // > > > > > top position of #myDiv > > > > > > $(mt).css('height', wh - mt - 20 + 'px'); // > > > > > set height of #myDiv > > > > > > On Sep 29, 8:33 am, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > > > > > > > Well, the $(window).height() gets the height for me. > > > > > > > What I need is something to measure the distance from the window top > > > > > > and down to the element top. > > > > > > And then subtract it from the window height, minus another 20 pix ad > > > > > > use that value as height for the div. > > > > > > > If the window is 1000 px high, and the div starts 300px down, I'd > > > > > > like > > > > > > to get 100 - 300 - 20 = 680 > > > > > > And then apply this as height for the div. > > > > > > > And this needs to be done without mixing in other elements that > > > > > > might > > > > > > or might not be part of the dom tree between the window top and the > > > > > > elements top position. > > > > > > > So I guess that the problem lies within the second measuring > > > > > > parameter > > > > > > of my function: > > > > > > $ (".tableHo
[jQuery] Re: Insert content in row
Wonderful!!! Thanx p.s.: to avoid several appended content I used: $( '#' + this.id + '_injected' ).html(''); On Tue, Sep 30, 2008 at 3:39 PM, BB <[EMAIL PROTECTED]> wrote: > > Try this: > $('.rowContent').click(function(){ > var row = this; > $.get("getCountryContent.cfm", { u: row.id }, function(data){ >// this == the options for this ajax request >var $conteudo = trim12( data ); >alert("Data Loaded: " + $conteudo); >$( '#' + row.id ).append( $conteudo ); > }); > }); > > http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype > > On 30 Sep., 20:27, "Web Specialist" <[EMAIL PROTECTED]> wrote: > > Hi all. I have this very simple content: > > > > > > United States > > > > > > Canada > > > > > > When user clicks in any row i'll want to display the details about that > row. > > I'm using this but without success: > > > > $('.rowContent').click(function(){ > > $.get("getCountryContent.cfm", { u: this.id }, > > function(data){ > > var $conteudo = trim12( data ); > > alert("Data Loaded: " + trim12( data )); > > $( '#' + this.id ).html(trim12( data )).append(); > > }); > > > > }); > > > > This ajax response is an html table... > > > > What's wrong? > > > > Cheers > > Marco Antonio >
[jQuery] Re: Select multiple iterating over selections from database
hmmm, would be more straight up js than jQuery if you had: Bob Doug Jake Steve Mike John //values from database in some enumerable object var vfdb = new Array("1", "4", "6"); //loop and set var lst = $("Users")[0]; for (var i=0; i < lst.options.length; i++) { for (var j=0; j < vfdb.length; j++) { if (lst.options[i].value == vfdb[j]) { lst.options[i].selected == true; break; } } } of course that could be included in the success callback of some sort of $.ajax call or whatever On Sep 30, 9:51 am, "Allen Schmidt" <[EMAIL PROTECTED]> wrote: > Greetings, > If I have a select multiple set up with say 10 items, and I am making a pass > over them from a call to a database that returns some of those values (more > than one), how can I check to see if an option in the select is one of the > items returned from the database and select it also? > Thanks! > > Allen
[jQuery] Re: Set height of element depending on only on its own position and window height?
I might add that you may be able to accomplish the same thing in 'modern' browsers (e.g. not IE6) with just css, using absolute positioning. Just set your right, left and bottom to, for example, 10px. (IE6 can't handle positioning on 3 sides). On Sep 30, 11:58 am, rolfsf <[EMAIL PROTECTED]> wrote: > Glad you solved it. I actually had a mistake in my last line, but > here's a working version: > > http://www.monkeypuzzle.net/testfiles/jquery/divSize.htm > > I added a window resize function so it always adapts to the window. As > you can see, nothing is absolutely positioned, and I threw a mixture > of elements above the div I wanted to size, just to confirm that it > really doesn't care what's there - it's measuring the offset from the > top of the window. > > On Sep 30, 3:26 am, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > > > Well, I managed to solve it. > > > Using option relativeTo for the offset and setting the relativeTo to > > use my header div that is always present, and always absolutely > > positioned at top:0; > > > Now I have a div that takes up whatever space is left down to bottom > > of viewport, just like I wanted. Thanks for all help! > > > On 30 Sep, 10:18, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > > > > Well, thanks, but it turns out that it does exactly the same as my own > > > function. > > > If I have a div above it with a SET TOP position, e.g. css: top:0; - > > > or whatever - it works. > > > But if I don't have nothing but a bunch of tags above the div, > > > or if I set the div above to psition:relative and remove the set top > > > position, it doesn't work anymore. > > > I really need some way to get the top offset for my div from the top > > > edge of the window, no matter what may or may not be above the div in > > > the DOM tree, and so far no luck. > > > But thanks for the effort, I appreciate it. > > > > /Torgil > > > > On 29 Sep, 21:26, rolfsf <[EMAIL PROTECTED]> wrote: > > > > > try this: > > > > > var wh = $(window).height(); // window height > > > > var mt = $('#myDiv').offset().top; // top > > > > position of #myDiv > > > > > $(mt).css('height', wh - mt - 20 + 'px'); // set > > > > height of #myDiv > > > > > On Sep 29, 8:33 am, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > > > > > > Well, the $(window).height() gets the height for me. > > > > > > What I need is something to measure the distance from the window top > > > > > and down to the element top. > > > > > And then subtract it from the window height, minus another 20 pix ad > > > > > use that value as height for the div. > > > > > > If the window is 1000 px high, and the div starts 300px down, I'd like > > > > > to get 100 - 300 - 20 = 680 > > > > > And then apply this as height for the div. > > > > > > And this needs to be done without mixing in other elements that might > > > > > or might not be part of the dom tree between the window top and the > > > > > elements top position. > > > > > > So I guess that the problem lies within the second measuring parameter > > > > > of my function: > > > > > $ (".tableHolder").offset().top - this for some reason uses other > > > > > positioned elements for its calculation, and I need it not to. > > > > > > Regards, Torgil - kabelkultur.se- Dölj citerad text - > > > > > - Visa citerad text -- Dölj citerad text - > > > > - Visa citerad text -
[jQuery] Re: select data in a ignoring the
NodeTypeNamed Constant 1 ELEMENT_NODE 2 ATTRIBUTE_NODE 3 TEXT_NODE 4 CDATA_SECTION_NODE 5 ENTITY_REFERENCE_NODE 6 ENTITY_NODE 7 PROCESSING_INSTRUCTION_NODE 8 COMMENT_NODE 9 DOCUMENT_NODE 10 DOCUMENT_TYPE_NODE 11 DOCUMENT_FRAGMENT_NODE 12 NOTATION_NODE from: http://www.w3schools.com/Dom/dom_nodetype.asp I had to check for nodeType == 3 since the text nodes do not have an innerHtml property. Also, after some reading, I think 'node.nodeValue' would be more "proper" over 'node.data' I'd like to see how you get it to work better with jQuery, or rather, "native jQuery". I'll try it myself, but I'd like to see how others would implement it. On Sep 30, 2:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > Wow amazing... it worked let me ask you question I think I can do it > with jQuery .. > do you know what does node.nodeType mean in javascript > nodeType=1 what does that mean for each value ? > thanks Pedram > > On Sep 30, 8:29 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > I'm not sure how to do it in a "jQuery" way. But here's what I came up > > with: > > > $( function(){ > > $("p").each( function() { > > var allButSpan = this.allButSpan = new Array(); > > $.each(this.childNodes, function(i, node) { > > if (node.nodeName.toLowerCase() != "span") > > { allButSpan[allButSpan.length] = node; } > > }); > > }); > > > $("p").each( function(){ > > var innerHtml = ""; > > $.each(this.allButSpan, function(i, node) { innerHtml += > > (node.nodeType == 3) ? node.data : $(node).html(); } ); > > console.log(innerHtml); > > }); > > > }); > > > Example here:http://joeflateau.net/playground/testingpexcspan.html > > > You need Firebug (or anything that supports console.log) to use the > > example! > > > On Sep 30, 12:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > > > > It didn't work Cause the Text isn't concern as a Children and it is in > > > No Tag area so when we call $(this).children it returns only the > > > Span and if we do $(this).children(":not(span)") it returns NULL ... > > > so Equally. what should we do > > > > On Sep 30, 5:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > Ok, how about something to the effect of: > > > > > $("p").each(function() { $ > > > > (this).children(":not(span)").css({color:"red"}); }); > > > > > On Sep 30, 8:12 am, [EMAIL PROTECTED] wrote: > > > > > > If I do this with CLone then all my prossesing is with the clone but I > > > > > need to have a selector in the Original one not in the Clone so > > > > > changing and modifying the clone is not necessary ,the only way is get > > > > > a Clone of THe Span Then Remove the Span and then get the content of > > > > > the P do some changes on it , after that add the Span again And I > > > > > think this is not the right way to Deal with this ... > > > > > I'm still working on thiws and waiting for the best way to it > > > > > Thanks Pedram > > > > > > On Sep 30, 7:36 am, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > > $("p:not(span)") would select all paragraphs that are not spans... > > > > > > which would be all paragraphs even if they have a child that is a > > > > > > span. > > > > > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs > > > > > > without child spans... which would be none of the paragraphs. > > > > > > > He needs the contents of all paragraphs minus the content of a span. > > > > > > The only way (I can think of) to non-destructively get the contents > > > > > > of > > > > > > an element minus some of its children is to clone it first, then > > > > > > remove the children. > > > > > > > On Sep 29, 3:33 pm, dasacc22 <[EMAIL PROTECTED]> wrote: > > > > > > > > um cant you just do something like $("p:not(span)") ?? > > > > > > > > On Sep 28, 3:48 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > > > > This should work: > > > > > > > > > var clone = $("p").clone(); > > > > > > > > clone.find("span").remove(); > > > > > > > > > clone.each( function() { console.log(this) } ); > > > > > > > > > On Sep 28, 2:13 pm, [EMAIL PROTECTED] wrote: > > > > > > > > > > Hi Guys, > > > > > > > > > > this is the Code which I am working on > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > How could FIlter and Select the text Before the > > > > > > > > > does someone has an Idea ?
[jQuery] Re: Set height of element depending on only on its own position and window height?
Glad you solved it. I actually had a mistake in my last line, but here's a working version: http://www.monkeypuzzle.net/testfiles/jquery/divSize.htm I added a window resize function so it always adapts to the window. As you can see, nothing is absolutely positioned, and I threw a mixture of elements above the div I wanted to size, just to confirm that it really doesn't care what's there - it's measuring the offset from the top of the window. On Sep 30, 3:26 am, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > Well, I managed to solve it. > > Using option relativeTo for the offset and setting the relativeTo to > use my header div that is always present, and always absolutely > positioned at top:0; > > Now I have a div that takes up whatever space is left down to bottom > of viewport, just like I wanted. Thanks for all help! > > On 30 Sep, 10:18, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > > > Well, thanks, but it turns out that it does exactly the same as my own > > function. > > If I have a div above it with a SET TOP position, e.g. css: top:0; - > > or whatever - it works. > > But if I don't have nothing but a bunch of tags above the div, > > or if I set the div above to psition:relative and remove the set top > > position, it doesn't work anymore. > > I really need some way to get the top offset for my div from the top > > edge of the window, no matter what may or may not be above the div in > > the DOM tree, and so far no luck. > > But thanks for the effort, I appreciate it. > > > /Torgil > > > On 29 Sep, 21:26, rolfsf <[EMAIL PROTECTED]> wrote: > > > > try this: > > > > var wh = $(window).height(); // window height > > > var mt = $('#myDiv').offset().top; // top > > > position of #myDiv > > > > $(mt).css('height', wh - mt - 20 + 'px'); // set > > > height of #myDiv > > > > On Sep 29, 8:33 am, Kabelkultur Gotland <[EMAIL PROTECTED]> wrote: > > > > > Well, the $(window).height() gets the height for me. > > > > > What I need is something to measure the distance from the window top > > > > and down to the element top. > > > > And then subtract it from the window height, minus another 20 pix ad > > > > use that value as height for the div. > > > > > If the window is 1000 px high, and the div starts 300px down, I'd like > > > > to get 100 - 300 - 20 = 680 > > > > And then apply this as height for the div. > > > > > And this needs to be done without mixing in other elements that might > > > > or might not be part of the dom tree between the window top and the > > > > elements top position. > > > > > So I guess that the problem lies within the second measuring parameter > > > > of my function: > > > > $ (".tableHolder").offset().top - this for some reason uses other > > > > positioned elements for its calculation, and I need it not to. > > > > > Regards, Torgil - kabelkultur.se- Dölj citerad text - > > > > - Visa citerad text -- Dölj citerad text - > > > - Visa citerad text -
[jQuery] Re: Getting the id of the next form
Try this: full jQuery $("a.ctrl_s").bind("click",function() {saveForm( $ (this).next().attr("id") );}); would get the element after the "A" => "FORM" then get its id On 30 Sep., 11:02, Bruce MacKay <[EMAIL PROTECTED]> wrote: > Hello folks, > > I have a page containing a number of forms e.g. > > > [an image] > > [various form elements] > > > > > [an image] > > [various form elements] > > > > The class "ctrl_s" is bound to a function that will serialize the > contents of the form and send the contents (via ajax) to the server > for processing > > $("a.ctrl_s").bind("click",function() {saveForm( [the id of the next > form] );}); > > How do I get the "id of the next form" for sending to the "saveForm" > function? I'm afraid that I just don't yet understand selectors and > traversing well enough to nut this out myself. > > Thanks, > > Bruce
[jQuery] Re: Insert content in row
Try this: $('.rowContent').click(function(){ var row = this; $.get("getCountryContent.cfm", { u: row.id }, function(data){ // this == the options for this ajax request var $conteudo = trim12( data ); alert("Data Loaded: " + $conteudo); $( '#' + row.id ).append( $conteudo ); }); }); http://docs.jquery.com/Ajax/jQuery.get#urldatacallbacktype On 30 Sep., 20:27, "Web Specialist" <[EMAIL PROTECTED]> wrote: > Hi all. I have this very simple content: > > > United States > > > Canada > > > When user clicks in any row i'll want to display the details about that row. > I'm using this but without success: > > $('.rowContent').click(function(){ > $.get("getCountryContent.cfm", { u: this.id }, > function(data){ > var $conteudo = trim12( data ); > alert("Data Loaded: " + trim12( data )); > $( '#' + this.id ).html(trim12( data )).append(); > }); > > }); > > This ajax response is an html table... > > What's wrong? > > Cheers > Marco Antonio
[jQuery] Re: select data in a ignoring the
Wow amazing... it worked let me ask you question I think I can do it with jQuery .. do you know what does node.nodeType mean in javascript nodeType=1 what does that mean for each value ? thanks Pedram On Sep 30, 8:29 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > I'm not sure how to do it in a "jQuery" way. But here's what I came up > with: > > $( function(){ > $("p").each( function() { > var allButSpan = this.allButSpan = new Array(); > $.each(this.childNodes, function(i, node) { > if (node.nodeName.toLowerCase() != "span") > { allButSpan[allButSpan.length] = node; } > }); > }); > > $("p").each( function(){ > var innerHtml = ""; > $.each(this.allButSpan, function(i, node) { innerHtml += > (node.nodeType == 3) ? node.data : $(node).html(); } ); > console.log(innerHtml); > }); > > }); > > Example here:http://joeflateau.net/playground/testingpexcspan.html > > You need Firebug (or anything that supports console.log) to use the > example! > > On Sep 30, 12:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > > > It didn't work Cause the Text isn't concern as a Children and it is in > > No Tag area so when we call $(this).children it returns only the > > Span and if we do $(this).children(":not(span)") it returns NULL ... > > so Equally. what should we do > > > On Sep 30, 5:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > Ok, how about something to the effect of: > > > > $("p").each(function() { $ > > > (this).children(":not(span)").css({color:"red"}); }); > > > > On Sep 30, 8:12 am, [EMAIL PROTECTED] wrote: > > > > > If I do this with CLone then all my prossesing is with the clone but I > > > > need to have a selector in the Original one not in the Clone so > > > > changing and modifying the clone is not necessary ,the only way is get > > > > a Clone of THe Span Then Remove the Span and then get the content of > > > > the P do some changes on it , after that add the Span again And I > > > > think this is not the right way to Deal with this ... > > > > I'm still working on thiws and waiting for the best way to it > > > > Thanks Pedram > > > > > On Sep 30, 7:36 am, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > $("p:not(span)") would select all paragraphs that are not spans... > > > > > which would be all paragraphs even if they have a child that is a > > > > > span. > > > > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs > > > > > without child spans... which would be none of the paragraphs. > > > > > > He needs the contents of all paragraphs minus the content of a span. > > > > > The only way (I can think of) to non-destructively get the contents of > > > > > an element minus some of its children is to clone it first, then > > > > > remove the children. > > > > > > On Sep 29, 3:33 pm, dasacc22 <[EMAIL PROTECTED]> wrote: > > > > > > > um cant you just do something like $("p:not(span)") ?? > > > > > > > On Sep 28, 3:48 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > > > This should work: > > > > > > > > var clone = $("p").clone(); > > > > > > > clone.find("span").remove(); > > > > > > > > clone.each( function() { console.log(this) } ); > > > > > > > > On Sep 28, 2:13 pm, [EMAIL PROTECTED] wrote: > > > > > > > > > Hi Guys, > > > > > > > > > this is the Code which I am working on > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > How could FIlter and Select the text Before the > > > > > > > > does someone has an Idea ?
[jQuery] Re: Intercept "Back" button click on browser
Leanan wrote on 9/30/2008 10:10 AM: > How can I make it so that when the user clicks the back button in > their browser, this same thing happens, as I'll likely have people > trying to click the back button instead of the back link on the "page" > and then tell me it's broken. Is it even possible? You'll want to use one of the history plug-ins: http://plugins.jquery.com/project/history http://plugins.jquery.com/project/jHistory And the jQuery UI project has a history feature, although it sounds like it needs some work: http://docs.jquery.com/UI/Tabs#Does_UI_Tabs_support_back_button_and_bookmarking_of_tabs.3F - Bil
[jQuery] Insert content in row
Hi all. I have this very simple content: United States Canada When user clicks in any row i'll want to display the details about that row. I'm using this but without success: $('.rowContent').click(function(){ $.get("getCountryContent.cfm", { u: this.id }, function(data){ var $conteudo = trim12( data ); alert("Data Loaded: " + trim12( data )); $( '#' + this.id ).html(trim12( data )).append(); }); }); This ajax response is an html table... What's wrong? Cheers Marco Antonio
[jQuery] Getting the id of the next form
Hello folks, I have a page containing a number of forms e.g. [an image] [various form elements] [an image] [various form elements] The class "ctrl_s" is bound to a function that will serialize the contents of the form and send the contents (via ajax) to the server for processing $("a.ctrl_s").bind("click",function() {saveForm( [the id of the next form] );}); How do I get the "id of the next form" for sending to the "saveForm" function? I'm afraid that I just don't yet understand selectors and traversing well enough to nut this out myself. Thanks, Bruce
[jQuery] Re: I want to reduce the header calls
found this... may-be this may help ??? if (navigator.browserLanguage){language=navigator.browserLanguage} if (navigator.userLanguage){language=navigator.userLanguage} if (navigator.systemLanguage){language=navigator.systemLanguage} if (navigator.language){language=navigator.language} if (language.indexOf('-')==2) {language=language.substring(0,2);} if (language=='en') { document.write("Hello there!"); } else if (language=='jp') { document.write("Konichiwa!"); } else if (language=='fr') { document.write("Bonjour!"); } On Sep 30, 9:47 am, jeremyBass <[EMAIL PROTECTED]> wrote: > So I think this is the ticket... but I really am not to sure on the > how yet... > > http://code.google.com/p/urlrewritefilter/ > > anyone have a sec to help me out with this? thank you > jeremyBass > > On Sep 29, 7:37 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > I new that was to good to be true... well moving on to a new view > > There has to be a way to "capture" the HTTP requests ... I think I've > > seen URL rewrites with javascript... so may-be I could have it so that > > it's more like this... if HTPP request is in array die else execute > > and push URL to array? any ideas on that? > > > thanks for the help... > > jeremyBass > > > On Sep 29, 4:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > Oops, sorry, what I meant is that cloning the elements is the best > > > optimization you can do. It will save you some processing time from > > > not creating new elements (or maybe not, as jQuery will be re-creating > > > the clone element), but the HTTP requests will remain. > > > > $('#flash-round-corner- > > > thing').clone().appendTo('newcorner').clone().appendTo('anothercorner') > > > etc. > > > > On Sep 29, 1:08 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > Thank you for the help... > > > > > >>> And using dozens of flash objects to round corners doesn't seem > > > > >>> like a > > > > >>> good idea... > > > > > Yeah I thought there would be alot of trouble to at first... but it's > > > > better then cornflex and jcorner altogether... it's absolutely working > > > > perfectly. the 10-12 calls are on the first download only and it's > > > > not the round boxes... it's mostly the srif anyways... but that's > > > > ok... I'm just being anal and trying to work out everything before I > > > > share this with everyone. right now the round box mod is total 1kb > > > > big if you already have jflash.js. And it's... well I'll share this > > > > all in bit... I want to protect it and have never done that before... > > > > like a gpl? or something... anyways... > > > > > >>> If the element is already being cloned instead of being created > > > > >>> again, > > > > >>> there is no fix. > > > > > so if they aren't? I could reuse the element with the new vars? then > > > > I would only have made one call as long as I don't change the > > > > source... smashing! now how to write that... :-) any more ideas on > > > > this? > > > > > thanks for the help... > > > > jeremyBass > > > > > On Sep 28, 8:31 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > > If the element is already being cloned instead of being created again, > > > > > there is no fix. You can create/clone/append/modify an image or object > > > > > tag, but it will always need to request it's content from the server. > > > > > And using dozens of flash objects to round corners doesn't seem like a > > > > > good idea... > > > > > > On Sep 28, 6:14 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > I'm so it is be cahced but the HTTP requests on the dead download is > > > > > > still high... I'm not sure how to stop it frm makeing the requests > > > > > > sice the first time it runs through the functions it has downloaded > > > > > > the swf so no need to make a new HTTP request... any ideas on this? > > > > > > > On Sep 28, 10:56 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > > Does anyone have an idea on this... or , and I don't do this well > > > > > > > and > > > > > > > lot lol, but am I not being clear? I really need to figure this > > > > > > > out... Thanks > > > > > > > jeremyBass > > > > > > > > On Sep 27, 3:21 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > > > Hello, I want to reduce the header calls for a flash file used > > > > > > > > repeatedly on a page. There are 24 HTTP requests for a file > > > > > > > > that is > > > > > > > > already downloaded.. So My question is how would I call it once > > > > > > > > and > > > > > > > > then not again for the rest of the page? > > > > > > > > > the code area is like this > > > > > > > > > ex.1) > > > > > > > > > src: (p.path || '').replace(/([^\/])$/, '$1/') + (p.font || > > > > > > > > ele.css('fontFamily').replace(/^\s+|\s+$|,[\S|\s]+|'|"|(,)\s+/g, > > > > > > > > '$1')).replace(/([^\.][^s][^w][^f])$/, '$1.swf'), > > > > > > > > > ex.2) > > > > > > > > > var SORUCE = 'Scripts/flash/rounded_rectangle.swf'; > > > > > > > > $('.Round_gen53').attr('rel',
[jQuery] Re: Hidden spam on jquery blog
Woops looks like jQuery blog got hit by a sql-injection attack! On Sep 30, 2:04 pm, zaadjis <[EMAIL PROTECTED]> wrote: > Right after the script tag with urchin.js. Can the powers that be fix > this, please?
[jQuery] Re: prevent tab changing + user message
Hi. Nobody can help me with this issue? I don´t know if is crearly enough: On the select propertie of the tab I call a function. This works great with validation plugin, due to it returns true or false without user action. the problem is when I present a dialog to the user in order to determine weather to return true or false. when I launch the dialog, it returns true to the select tab event, so despite the dialog launchs and wait for user choice, the tab has already changed. thanks On 14 sep, 11:51, oscarml <[EMAIL PROTECTED]> wrote: > Hi klaus, > > I had already read the FAQ, and as you can see in my code I'm using > the select property. This works fine for example if you run a function > that returns true or false without asking user anything, but in my > case I need the user to choose one option. Then, when I offer the > dialog box, the code inside the 'select' property is returning true, > before the user press a button. > > Any idea? > > On 1 sep, 06:18, Klaus Hartl <[EMAIL PROTECTED]> wrote: > > > See > > FAQ:http://docs.jquery.com/UI/Tabs#...prevent_switching_to_the_tab_on_cli... > > > --Klaus > > > On Aug 31, 5:23 pm,oscarml<[EMAIL PROTECTED]> wrote: > > > > Hi to everybody, > > > > I'm trying to control tab switching depending on user answer to a > > > dialog. Here is my code; > > > > var TabSolicitud = $('#SolicitudAguaTabContainer > ul').tabs({ > > > select: function(e, ui){ > > > $("#InfoDialog").html("Do you want to save > > > changes?"); > > > $("#InfoDialog").dialog({ > > > modal: true, > > > addClass: 'ModalInfo', > > > resizable: false, > > > title: " > > src='imagenes/messagebox_info.png' class='img_title' /> ", > > > > overlay: { > > > opacity: 0.5, > > > background: "black" > > > }, > > > buttons: { > > > "Yes": function() { > > > > > > $(this).dialog("close"); > > > SaveChanges(); > > > }, > > > "NO": function() { > > > $(this).dialog("close"); > > > return false; > > > } > > > > }); > > > > The problem is that when I show the dialog, the tab switched to the > > > selected one. It doesn´t wait until it knows the answer of the user. > > > > What could I do?
[jQuery] Hidden spam on jquery blog
Right after the script tag with urchin.js. Can the powers that be fix this, please?
[jQuery] Re: [validate] Validation max number of checkboxes
jQuery:$(document).ready(function(){ $('#go').click(function(){var i = $('#my-form input[name="test"]:checked').size(); if (i == 0 || i > 5) { alert('Choose from 1 to 5 options'); } }); }); HTML: Check 1 Check 2 Check 3 Check 4 Check 5 Check 6 Check 7 Check 8 Check 9 Check 10 Mauricio
[jQuery] Re: jquery code works with firefox but not ie.
I tried the code without ajax. It works in firefox but not in ie. I modelled my code on this example from the sitepoint jquery ajax tutorial. AJAX with jQuery Example $(document).ready(function(){ timestamp = 0; updateMsg(); $("form#chatform").submit(function(){ $.post("backend.php",{ message: $("#msg").val(), name: $("#author").val(), action: "postmsg", time: timestamp }, function(xml) { $("#msg").empty(); addMessages(xml); }); return false; }); }); function addMessages(xml) { if($("status",xml).text() == "2") return; timestamp = $("time",xml).text(); $("message",xml).each(function(id) { message = $("message",xml).get(id); $("#messagewindow").prepend(""+$("author",message).text()+ ": "+$("text",message).text()+ "
"); }); } function updateMsg() { $.post("backend.php",{ time: timestamp }, function(xml) { $("#loading").remove(); addMessages(xml); }); setTimeout('updateMsg()', 4000); } #messagewindow { height: 250px; border: 1px solid; padding: 5px; overflow: auto; } #wrapper { margin: auto; width: 438px; } Loading... Name: Message: This code works in both firefox and ie. I can't figure out what I am doing differently that makes my code not work with ie. On Tue, Sep 30, 2008 at 12:53 PM, Eric <[EMAIL PROTECTED]> wrote: > > I'm a little concerned by this line: > client = $("client",data).get(id); > > I'd recommend putting a "var" in front so that you have a local, not a > global, variable. > It also seems to me like $("client",data).get(id) is equivalent to > 'this' inside the each. > > so instead of: client = $("client",data).get(id); > use: var client = this; > > I've never tried to use jQuery with IE and XML data, so I'm not sure > what quirks might be caused by that combination. > > I would recommend trying your function without the AJAX call: > var data = insert_your_xml_here; > $("client",data).each(function(id) { >client = $("client",data).get(id); >$("#left_items").append(" href='#'>"+$("name",client).text()+""); >}); > > If none of that helps, I'd recommend installing Firebug, and doing > some heavy console logging ( http://getfirebug.com/console.html ), > specifically of the variable 'client'. > > > > On Sep 30, 12:14 pm, "silk.odyssey" <[EMAIL PROTECTED]> wrote: > > I have the following code that works in firefox and google chrome > > using jquery 1.2.6. > > > > function setUpClient() > > { > > $.post("http://localhost/gestivov2/include/ajax/getclients.php";, > {}, > > function(data){ > > $('#left_items').empty(); > > //alert(data); > > $("client",data).each(function(id) { > > client = $("client",data).get(id); > > $("#left_items").append(" id='"+$("id",client).text()+"'> > href='#'>"+$("name",client).text()+""); > > }); > > }) > > > > } > > > > It doesn't work with internet explorer 7, 8 beta nor 6. If I uncomment > > the alert code, the xml data gets displayed so it looks like the code > > within the each block is not being executed. What am i doing wrong? >
[jQuery] coda-slider: adding internal [prev] and [next] links
I'm using Nial Doherty's coda-slider plugin (http://plugins.jquery.com/ project/Coda-Slider), and trying to tweak it. I'm creating several instances of the slider on a page. I'd like to replicate the function of the 'previous' and 'next' buttons, but inside the content panels themselves. The code in coda-slider.1.1.1.js contains the following (for the 'previous' button): jQuery(this).before(''); jQuery("div#stripNavL" + j + " a").click(function(){ this.blur(); if (cPanel == 1) { var cnt = - (panelWidth*(panelCount - 1)); cPanel = panelCount; } else { cPanel -= 1; var cnt = - (panelWidth*(cPanel - 1)); }; jQuery(this).parent().parent().find("div.panelContainer").animate({ left: cnt}, settings.easeTime, settings.easeFunc); Change the URL hash (cross-linking)... location.hash = cPanel; return false; }); That seems pretty simple to me. I thought I could replicate it by duplicating it for all my 'previous' buttons in the various sliders, so I added this: jQuery("a.inner_prev_version").click(function(){ if (cPanel == 1) { var cnt = - (panelWidth*(panelCount - 1)); cPanel = panelCount; } else { cPanel -= 1; var cnt = - (panelWidth*(cPanel - 1)); }; jQuery(this).parent().parent().parent().parent().parent().parent().find("div.panelContainer").animate({ left: cnt}, settings.easeTime, settings.easeFunc); return false; }); Which adds the same functionality to all links in the actual panel contents. Except it's not. What's happening is that it seems to be calling the animation effect multiple times - I click a link, and the panel goes flying off to God knows where. One thing I'm suspicious of is my use of so many parent() calls to work my way back up to the slider-wrap div. In the original click handlers, I added: console.log(jQuery(this).parent().parent()); and it logs one element. But in my new click handlers, if I log the same: console.log(jQuery(this).parent().parent().parent().parent().parent().parent()); then twelve log entries show up, all logging a slider-wrap div element. Clearly this is a bit complicated, and thankyou for getting this far. I don't expect a solution - there could be so many possible causes - but any advice would be hugely appreciated Cheers.
[jQuery] Re: select data in a ignoring the
I'm not sure how to do it in a "jQuery" way. But here's what I came up with: $( function(){ $("p").each( function() { var allButSpan = this.allButSpan = new Array(); $.each(this.childNodes, function(i, node) { if (node.nodeName.toLowerCase() != "span") { allButSpan[allButSpan.length] = node; } }); }); $("p").each( function(){ var innerHtml = ""; $.each(this.allButSpan, function(i, node) { innerHtml += (node.nodeType == 3) ? node.data : $(node).html(); } ); console.log(innerHtml); }); }); Example here: http://joeflateau.net/playground/testingpexcspan.html You need Firebug (or anything that supports console.log) to use the example! On Sep 30, 12:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > It didn't work Cause the Text isn't concern as a Children and it is in > No Tag area so when we call $(this).children it returns only the > Span and if we do $(this).children(":not(span)") it returns NULL ... > so Equally. what should we do > > On Sep 30, 5:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > Ok, how about something to the effect of: > > > $("p").each(function() { $ > > (this).children(":not(span)").css({color:"red"}); }); > > > On Sep 30, 8:12 am, [EMAIL PROTECTED] wrote: > > > > If I do this with CLone then all my prossesing is with the clone but I > > > need to have a selector in the Original one not in the Clone so > > > changing and modifying the clone is not necessary ,the only way is get > > > a Clone of THe Span Then Remove the Span and then get the content of > > > the P do some changes on it , after that add the Span again And I > > > think this is not the right way to Deal with this ... > > > I'm still working on thiws and waiting for the best way to it > > > Thanks Pedram > > > > On Sep 30, 7:36 am, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > $("p:not(span)") would select all paragraphs that are not spans... > > > > which would be all paragraphs even if they have a child that is a > > > > span. > > > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs > > > > without child spans... which would be none of the paragraphs. > > > > > He needs the contents of all paragraphs minus the content of a span. > > > > The only way (I can think of) to non-destructively get the contents of > > > > an element minus some of its children is to clone it first, then > > > > remove the children. > > > > > On Sep 29, 3:33 pm, dasacc22 <[EMAIL PROTECTED]> wrote: > > > > > > um cant you just do something like $("p:not(span)") ?? > > > > > > On Sep 28, 3:48 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > > This should work: > > > > > > > var clone = $("p").clone(); > > > > > > clone.find("span").remove(); > > > > > > > clone.each( function() { console.log(this) } ); > > > > > > > On Sep 28, 2:13 pm, [EMAIL PROTECTED] wrote: > > > > > > > > Hi Guys, > > > > > > > > this is the Code which I am working on > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > Data in a Span > > > > > > > > > > > > > > How could FIlter and Select the text Before the > > > > > > > does someone has an Idea ?
[jQuery] Re: select data in a ignoring the
Dear Eric , It didn't work $(this).contents() filters the span so when you configure the code to $ (this).contents().not('span') it returns Null I wonder how come jQuery doesn't have a something lilke --ignore-- built in forexample .. so we could have ignored all the SPANs !!! On Sep 30, 8:02 pm, Eric <[EMAIL PROTECTED]> wrote: > I apologize, I haven't tested this code: > > $('p').each( function () { > alert( $(this).contents().not('span').text() ); > > }); > > On Sep 30, 12:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > > > It didn't work Cause the Text isn't concern as a Children and it is in > > No Tag area so when we call $(this).children it returns only the > > Span and if we do $(this).children(":not(span)") it returns NULL ... > > so Equally. what should we do > > > On Sep 30, 5:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > Ok, how about something to the effect of: > > > > $("p").each(function() { $ > > > (this).children(":not(span)").css({color:"red"}); }); > > > > On Sep 30, 8:12 am, [EMAIL PROTECTED] wrote: > > > > > If I do this with CLone then all my prossesing is with the clone but I > > > > need to have a selector in the Original one not in the Clone so > > > > changing and modifying the clone is not necessary ,the only way is get > > > > a Clone of THe Span Then Remove the Span and then get the content of > > > > the P do some changes on it , after that add the Span again And I > > > > think this is not the right way to Deal with this ... > > > > I'm still working on thiws and waiting for the best way to it > > > > Thanks Pedram > > > > > On Sep 30, 7:36 am, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > $("p:not(span)") would select all paragraphs that are not spans... > > > > > which would be all paragraphs even if they have a child that is a > > > > > span. > > > > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs > > > > > without child spans... which would be none of the paragraphs. > > > > > > He needs the contents of all paragraphs minus the content of a span. > > > > > The only way (I can think of) to non-destructively get the contents of > > > > > an element minus some of its children is to clone it first, then > > > > > remove the children. > > > > > > On Sep 29, 3:33 pm, dasacc22 <[EMAIL PROTECTED]> wrote: > > > > > > > um cant you just do something like $("p:not(span)") ?? > > > > > > > On Sep 28, 3:48 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > > > This should work: > > > > > > > > var clone = $("p").clone(); > > > > > > > clone.find("span").remove(); > > > > > > > > clone.each( function() { console.log(this) } ); > > > > > > > > On Sep 28, 2:13 pm, [EMAIL PROTECTED] wrote: > > > > > > > > > Hi Guys, > > > > > > > > > this is the Code which I am working on > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > > Data in a Span > > > > > > > > > > > > > > > > How could FIlter and Select the text Before the > > > > > > > > does someone has an Idea ?
[jQuery] [validate] Validation max number of checkboxes
Hi, I'm trying to create a validation that would ensure that users select between 1-5 options out of a list of checkboxes with the same name. For example: Pick your favorite color (required, maximum of 5 selections). Is there any way to do this with the validate plugin? Thanks!
[jQuery] Re: select data in a ignoring the
I apologize, I haven't tested this code: $('p').each( function () { alert( $(this).contents().not('span').text() ); }); On Sep 30, 12:20 pm, Pedram <[EMAIL PROTECTED]> wrote: > It didn't work Cause the Text isn't concern as a Children and it is in > No Tag area so when we call $(this).children it returns only the > Span and if we do $(this).children(":not(span)") it returns NULL ... > so Equally. what should we do > > On Sep 30, 5:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > Ok, how about something to the effect of: > > > $("p").each(function() { $ > > (this).children(":not(span)").css({color:"red"}); }); > > > On Sep 30, 8:12 am, [EMAIL PROTECTED] wrote: > > > > If I do this with CLone then all my prossesing is with the clone but I > > > need to have a selector in the Original one not in the Clone so > > > changing and modifying the clone is not necessary ,the only way is get > > > a Clone of THe Span Then Remove the Span and then get the content of > > > the P do some changes on it , after that add the Span again And I > > > think this is not the right way to Deal with this ... > > > I'm still working on thiws and waiting for the best way to it > > > Thanks Pedram > > > > On Sep 30, 7:36 am, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > $("p:not(span)") would select all paragraphs that are not spans... > > > > which would be all paragraphs even if they have a child that is a > > > > span. > > > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs > > > > without child spans... which would be none of the paragraphs. > > > > > He needs the contents of all paragraphs minus the content of a span. > > > > The only way (I can think of) to non-destructively get the contents of > > > > an element minus some of its children is to clone it first, then > > > > remove the children. > > > > > On Sep 29, 3:33 pm, dasacc22 <[EMAIL PROTECTED]> wrote: > > > > > > um cant you just do something like $("p:not(span)") ?? > > > > > > On Sep 28, 3:48 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > > This should work: > > > > > > > var clone = $("p").clone(); > > > > > > clone.find("span").remove(); > > > > > > > clone.each( function() { console.log(this) } ); > > > > > > > On Sep 28, 2:13 pm, [EMAIL PROTECTED] wrote: > > > > > > > > Hi Guys, > > > > > > > > this is the Code which I am working on > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > > Data in a Span > > > > > > > > > > > > > > How could FIlter and Select the text Before the > > > > > > > does someone has an Idea ?
[jQuery] Re: jquery code works with firefox but not ie.
I'm a little concerned by this line: client = $("client",data).get(id); I'd recommend putting a "var" in front so that you have a local, not a global, variable. It also seems to me like $("client",data).get(id) is equivalent to 'this' inside the each. so instead of: client = $("client",data).get(id); use: var client = this; I've never tried to use jQuery with IE and XML data, so I'm not sure what quirks might be caused by that combination. I would recommend trying your function without the AJAX call: var data = insert_your_xml_here; $("client",data).each(function(id) { client = $("client",data).get(id); $("#left_items").append(""+$("name",client).text()+""); }); If none of that helps, I'd recommend installing Firebug, and doing some heavy console logging ( http://getfirebug.com/console.html ), specifically of the variable 'client'. On Sep 30, 12:14 pm, "silk.odyssey" <[EMAIL PROTECTED]> wrote: > I have the following code that works in firefox and google chrome > using jquery 1.2.6. > > function setUpClient() > { > $.post("http://localhost/gestivov2/include/ajax/getclients.php";, {}, > function(data){ > $('#left_items').empty(); > //alert(data); > $("client",data).each(function(id) { > client = $("client",data).get(id); > $("#left_items").append(" id='"+$("id",client).text()+"'> href='#'>"+$("name",client).text()+""); > }); > }) > > } > > It doesn't work with internet explorer 7, 8 beta nor 6. If I uncomment > the alert code, the xml data gets displayed so it looks like the code > within the each block is not being executed. What am i doing wrong?
[jQuery] Re: I want to reduce the header calls
So I think this is the ticket... but I really am not to sure on the how yet... http://code.google.com/p/urlrewritefilter/ anyone have a sec to help me out with this? thank you jeremyBass On Sep 29, 7:37 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > I new that was to good to be true... well moving on to a new view > There has to be a way to "capture" the HTTP requests ... I think I've > seen URL rewrites with javascript... so may-be I could have it so that > it's more like this... if HTPP request is in array die else execute > and push URL to array? any ideas on that? > > thanks for the help... > jeremyBass > > On Sep 29, 4:13 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > Oops, sorry, what I meant is that cloning the elements is the best > > optimization you can do. It will save you some processing time from > > not creating new elements (or maybe not, as jQuery will be re-creating > > the clone element), but the HTTP requests will remain. > > > $('#flash-round-corner- > > thing').clone().appendTo('newcorner').clone().appendTo('anothercorner') > > etc. > > > On Sep 29, 1:08 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > Thank you for the help... > > > > >>> And using dozens of flash objects to round corners doesn't seem like a > > > >>> good idea... > > > > Yeah I thought there would be alot of trouble to at first... but it's > > > better then cornflex and jcorner altogether... it's absolutely working > > > perfectly. the 10-12 calls are on the first download only and it's > > > not the round boxes... it's mostly the srif anyways... but that's > > > ok... I'm just being anal and trying to work out everything before I > > > share this with everyone. right now the round box mod is total 1kb > > > big if you already have jflash.js. And it's... well I'll share this > > > all in bit... I want to protect it and have never done that before... > > > like a gpl? or something... anyways... > > > > >>> If the element is already being cloned instead of being created again, > > > >>> there is no fix. > > > > so if they aren't? I could reuse the element with the new vars? then > > > I would only have made one call as long as I don't change the > > > source... smashing! now how to write that... :-) any more ideas on > > > this? > > > > thanks for the help... > > > jeremyBass > > > > On Sep 28, 8:31 pm, ricardobeat <[EMAIL PROTECTED]> wrote: > > > > > If the element is already being cloned instead of being created again, > > > > there is no fix. You can create/clone/append/modify an image or object > > > > tag, but it will always need to request it's content from the server. > > > > And using dozens of flash objects to round corners doesn't seem like a > > > > good idea... > > > > > On Sep 28, 6:14 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > I'm so it is be cahced but the HTTP requests on the dead download is > > > > > still high... I'm not sure how to stop it frm makeing the requests > > > > > sice the first time it runs through the functions it has downloaded > > > > > the swf so no need to make a new HTTP request... any ideas on this? > > > > > > On Sep 28, 10:56 am, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > Does anyone have an idea on this... or , and I don't do this well > > > > > > and > > > > > > lot lol, but am I not being clear? I really need to figure this > > > > > > out... Thanks > > > > > > jeremyBass > > > > > > > On Sep 27, 3:21 pm, jeremyBass <[EMAIL PROTECTED]> wrote: > > > > > > > > Hello, I want to reduce the header calls for a flash file used > > > > > > > repeatedly on a page. There are 24 HTTP requests for a file that > > > > > > > is > > > > > > > already downloaded.. So My question is how would I call it once > > > > > > > and > > > > > > > then not again for the rest of the page? > > > > > > > > the code area is like this > > > > > > > > ex.1) > > > > > > > > src: (p.path || '').replace(/([^\/])$/, '$1/') + (p.font || > > > > > > > ele.css('fontFamily').replace(/^\s+|\s+$|,[\S|\s]+|'|"|(,)\s+/g, > > > > > > > '$1')).replace(/([^\.][^s][^w][^f])$/, '$1.swf'), > > > > > > > > ex.2) > > > > > > > > var SORUCE = 'Scripts/flash/rounded_rectangle.swf'; > > > > > > > $('.Round_gen53').attr('rel',''+SORUCE +':::transparent: > > > > > > > 45:0:100:57:0:0x00:0xecffa4:15:2:2'); > > > > > > > $('.Round_gen54').attr('rel',''+SORUCE +':::transparent: > > > > > > > 45:0:100:57:0:0x00:0xecffa4:15:2:2'); > > > > > > > > and the functions get ran for each element... but I don't see why > > > > > > > the > > > > > > > repeated HTTP request is needed and it's slowing my site down... > > > > > > > So > > > > > > > says YSlow lol Any ideas on how to fix/write this? thank you > > > > > > > for > > > > > > > the help. > > > > > > > jeremyBass > > > > > > > > Some other things... > > > > > > > Configure ETags > > > > > > > Expires header > > > > > > > are set > > > > > > > as well as > > > > > > > > > > > > > > > Header set Cache-Control "max-age=604800" >
[jQuery] Re: Ajax Tabs and jqModal
on 9/30/08 8:17 AM, Klaus Hartl at [EMAIL PROTECTED] wrote: > > http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_workin > g_after_an_AJAX_request.3F > > If you choose to use rebinding, you would use the tabs load callback > for that. > > $('#tabs > ul').tabs({ > fx: { height: 'toggle', opacity: 'toggle' }, > load: function(e, ui) { > // rebind... > $('a', ui.panel); // => all links inside loaded tab content > } > }); > > --Klaus > > > On 30 Sep., 16:20, "Steffan A. Cline" <[EMAIL PROTECTED]> wrote: >> I have a scenario where I am using the jQuery UI tabs via ajax. The problem >> I am running into is that with this code: >> $().ready(function() { >> $('#tabs > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } }); >> $('#dialog').jqm({ajax: '@href', trigger: 'a.details'}); >> }); >> I am binding the jqmodal action to the existing links with the "details" >> class BUT problem is that items loaded via ajax do not subsequently get >> bound. Is there a trick to make jqmodal attach the links after each ajax >> call has been done? >> >> Thanks >> >> Steffan >> Klaus, Thanks for the quick answer! I did realize that the issue was that the items did not exist at the time of binding. I am new to jQuery and am trying to understand all the nice amenities we have now in comparison to hand coding all of this. I tried to implement your example as a drop in and it seemed to make no difference. Was there supposed to be more for me to add? Thanks Steffan --- T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4 Steffan A. Cline [EMAIL PROTECTED] Phoenix, Az http://www.ExecuChoice.net USA AIM : SteffanC ICQ : 57234309 YAHOO : Steffan_Cline MSN : [EMAIL PROTECTED] GOOGLE: Steffan.Cline Lasso Partner Alliance Member ---
[jQuery] Re: querying an array
I'm not sure why you are creating the array. If you don't need it for anything else then you can get at the html in one line: var test = $('.RepeatedItemElement[id = "headline"]', this.parent).html(); On Sep 30, 3:51 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I was expecting this kind of answer ! :) > > Could you ignore the fact that it has to be unique, let's say I want > to query on another attribute. And I want the query to limit the > search to the elements in my Array. > > How do I do that ? > > On 30 sep, 15:37, BB <[EMAIL PROTECTED]> wrote: > > > An ID has to be uniq so you can just do that: > > $("#headline").html(); > > > On 30 Sep., 15:40, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I've build the following array using all the element in this.parent > > > which have a class '.RepeatedItemElement' : > > > > this.elements = $(".RepeatedItemElement", this.parent); > > > > Now I want to query this array and get the innerHTML of the element > > > which has id='headline'. I've tried the following: > > > > var test = $(this.elements[id = "headline"]).html(); > > > > but it doesn't work. > > > > What is the correct way of doing this ? > > > > Thanks
[jQuery] Re: select data in a ignoring the
It didn't work Cause the Text isn't concern as a Children and it is in No Tag area so when we call $(this).children it returns only the Span and if we do $(this).children(":not(span)") it returns NULL ... so Equally. what should we do On Sep 30, 5:34 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > Ok, how about something to the effect of: > > $("p").each(function() { $ > (this).children(":not(span)").css({color:"red"}); }); > > On Sep 30, 8:12 am, [EMAIL PROTECTED] wrote: > > > If I do this with CLone then all my prossesing is with the clone but I > > need to have a selector in the Original one not in the Clone so > > changing and modifying the clone is not necessary ,the only way is get > > a Clone of THe Span Then Remove the Span and then get the content of > > the P do some changes on it , after that add the Span again And I > > think this is not the right way to Deal with this ... > > I'm still working on thiws and waiting for the best way to it > > Thanks Pedram > > > On Sep 30, 7:36 am, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > $("p:not(span)") would select all paragraphs that are not spans... > > > which would be all paragraphs even if they have a child that is a > > > span. > > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs > > > without child spans... which would be none of the paragraphs. > > > > He needs the contents of all paragraphs minus the content of a span. > > > The only way (I can think of) to non-destructively get the contents of > > > an element minus some of its children is to clone it first, then > > > remove the children. > > > > On Sep 29, 3:33 pm, dasacc22 <[EMAIL PROTECTED]> wrote: > > > > > um cant you just do something like $("p:not(span)") ?? > > > > > On Sep 28, 3:48 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > > This should work: > > > > > > var clone = $("p").clone(); > > > > > clone.find("span").remove(); > > > > > > clone.each( function() { console.log(this) } ); > > > > > > On Sep 28, 2:13 pm, [EMAIL PROTECTED] wrote: > > > > > > > Hi Guys, > > > > > > > this is the Code which I am working on > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > Data in a Span > > > > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > > Data in a Span > > > > > > > > > > > > How could FIlter and Select the text Before the > > > > > > does someone has an Idea ?
[jQuery] Re: jQuery validation plugin in Drupal
Could it have something to do with the fact that each id starts with "edit-"? When I try it with manually created markup, changing or removing the dashes doesn't help, but removing the "edit-" part does. Is there a workaround possible? Thanks, Jeroen On 29 sep, 00:06, Jeroen Coumans <[EMAIL PROTECTED]> wrote: > Hi, I've uploaded the form with the generated HTML markup at: > > http://lab.jeroencoumans.nl/register/ > > Thanks a lot, > Jeroen > > On 27 sep, 13:26, "Jörn Zaefferer" <[EMAIL PROTECTED]> > wrote: > > > Yes, an example would help a lot. > > > Jörn > > > On Sat, Sep 27, 2008 at 12:45 PM, Jeroen Coumans > > > <[EMAIL PROTECTED]> wrote: > > > > Thanks, I tried that but it doesn't seem to work. Drupal applies the > > > classes "required" to required form fields, and they're picked up > > > correctly. But any rule I add doesn't work at all. Even a single rule > > > to make an extra field required doesn't get picked up. > > > > Would it help if I setup an example of what I'm trying to achieve? > > > > Thanks, > > > Jeroen > > > > On 27 sep, 02:57, "Jörn Zaefferer" <[EMAIL PROTECTED]> > > > wrote: > > >> Yes, details can be found > > >> here:http://docs.jquery.com/Plugins/Validation/Reference#Fields_with_compl... > > > >> Jörn > > > >> On Sat, Sep 27, 2008 at 2:34 AM, Jeroen Coumans <[EMAIL PROTECTED]> > > >> wrote: > > > >> > Hi, > > > >> > When trying to use the validator plugin, I get the following error: > > > >> > missing : after property id > > >> > edit-name: "required", > > > >> > It seems like it has problems with the "-" that Drupal puts in the > > >> > id's of each form field. Is there a workaround possible? > > > >> > Thanks, > > >> > Jeroen Coumans
[jQuery] jquery code works with firefox but not ie.
I have the following code that works in firefox and google chrome using jquery 1.2.6. function setUpClient() { $.post("http://localhost/gestivov2/include/ajax/getclients.php";, {}, function(data){ $('#left_items').empty(); //alert(data); $("client",data).each(function(id) { client = $("client",data).get(id); $("#left_items").append(""+$("name",client).text()+""); }); }) } It doesn't work with internet explorer 7, 8 beta nor 6. If I uncomment the alert code, the xml data gets displayed so it looks like the code within the each block is not being executed. What am i doing wrong?
[jQuery] Intercept "Back" button click on browser
So here's the situation: I have a page that could potentially contain a massive amount of data. To try to decrease initial load time, I've broken it all out into nice chunks that get loaded via ajax. This works great. Some of the chunks need to appear as if they are their own page. To save on speed, all I do is hide all the prior content on the page and show the newly loaded content. When the user wants to go back, they click a link on this "new" page, which hides that content and re-shows the prior content. It works beautifully. Now the problem: How can I make it so that when the user clicks the back button in their browser, this same thing happens, as I'll likely have people trying to click the back button instead of the back link on the "page" and then tell me it's broken. Is it even possible?
[jQuery] Fire bug error : too much recursion
hi , I am getting this error in Firefox 3.0.2 fire bug console : too much recursion /misc/jquery.js Line 2 after some searching i found that it may be because of the jason library used .. can any one tell me how do i fix it .. In IE i got an alert saying that "Stack Overflow at line [line 1]"
[jQuery] Re: querying an array
Excuse my rather... verbose response. This should work for you, and is simpler: $("[attrib='value']", this.elements).html(); Although, now that I re-read your first post, it seems that you already know about the optional context parameter. I don't understand how this was a problem for you. On Sep 30, 11:41 am, equallyunequal <[EMAIL PROTECTED]> wrote: > jQuery( expression, [context] ) > > Note the optional context parameter. So, you can do this: > $("[attrib='value']", this.elements).each( function() > { console.log(this); } ); > > On Sep 30, 10:51 am, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > I was expecting this kind of answer ! :) > > > Could you ignore the fact that it has to be unique, let's say I want > > to query on another attribute. And I want the query to limit the > > search to the elements in my Array. > > > How do I do that ? > > > On 30 sep, 15:37, BB <[EMAIL PROTECTED]> wrote: > > > > An ID has to be uniq so you can just do that: > > > $("#headline").html(); > > > > On 30 Sep., 15:40, "[EMAIL PROTECTED]" > > > > <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > > I've build the following array using all the element in this.parent > > > > which have a class '.RepeatedItemElement' : > > > > > this.elements = $(".RepeatedItemElement", this.parent); > > > > > Now I want to query this array and get the innerHTML of the element > > > > which has id='headline'. I've tried the following: > > > > > var test = $(this.elements[id = "headline"]).html(); > > > > > but it doesn't work. > > > > > What is the correct way of doing this ? > > > > > Thanks
[jQuery] Re: querying an array
jQuery( expression, [context] ) Note the optional context parameter. So, you can do this: $("[attrib='value']", this.elements).each( function() { console.log(this); } ); On Sep 30, 10:51 am, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > I was expecting this kind of answer ! :) > > Could you ignore the fact that it has to be unique, let's say I want > to query on another attribute. And I want the query to limit the > search to the elements in my Array. > > How do I do that ? > > On 30 sep, 15:37, BB <[EMAIL PROTECTED]> wrote: > > > An ID has to be uniq so you can just do that: > > $("#headline").html(); > > > On 30 Sep., 15:40, "[EMAIL PROTECTED]" > > > <[EMAIL PROTECTED]> wrote: > > > Hi, > > > > I've build the following array using all the element in this.parent > > > which have a class '.RepeatedItemElement' : > > > > this.elements = $(".RepeatedItemElement", this.parent); > > > > Now I want to query this array and get the innerHTML of the element > > > which has id='headline'. I've tried the following: > > > > var test = $(this.elements[id = "headline"]).html(); > > > > but it doesn't work. > > > > What is the correct way of doing this ? > > > > Thanks
[jQuery] R: [jQuery] Re: R: [jQuery] Re: R: [jQuery] Show image gradually
Ciao Giovanni, happy that u think the same of me.. have you seen this http://www.pirolab.it/piro_09/slide.html no plugins, just jquery 1.2.6 that's it.. I've seen the plugin you linked and it's really compact, Alexander Farkas has done a nice work :) Diego --- Mar 30/9/08, Giovanni Battista Lenoci <[EMAIL PROTECTED]> ha scritto: Da: Giovanni Battista Lenoci <[EMAIL PROTECTED]> Oggetto: [jQuery] Re: R: [jQuery] Re: R: [jQuery] Show image gradually A: jquery-en@googlegroups.com Data: Martedì 30 settembre 2008, 17:24 diego valobra ha scritto: > Ciao Giovanni, some times it's good to understand the basic function > of jQuery without using plugins..that's what i was trying to do :) if > u never study u never lern!! > Ciao Diego, first of all I agree with you. :-) but... if it is only an exercise. in the minified version (i talk about 1.5 that I have on my HD) you have: ui.core.1.5.0.min.js 5 KB ui.slider.min.js 10KB jquery.bgpos.js (not minified) 1,19 KB. :-) ... and you can take a look at the plugin code (http://snook.ca/technical/jquery-bg/jquery.bgpos.js) to understand how the programmer has achieved is purpose :-) Bye -- gianiaz.net - web solutions p.le bertacchi 66, 23100 sondrio (so) - italy +39 347 7196482 Scopri il blog di Yahoo! Mail: Trucchi, novità e la tua opinione. http://www.ymailblogit.com/blog
[jQuery] Re: superfish and lightbox dont work together
Thanks .. I'll check it out. Sorry for late replay. Too much work :-(
[jQuery] Re: R: [jQuery] Re: R: [jQuery] Show image gradually
diego valobra ha scritto: Ciao Giovanni, some times it's good to understand the basic function of jQuery without using plugins..that's what i was trying to do :) if u never study u never lern!! Ciao Diego, first of all I agree with you. :-) but... if it is only an exercise. in the minified version (i talk about 1.5 that I have on my HD) you have: ui.core.1.5.0.min.js 5 KB ui.slider.min.js 10KB jquery.bgpos.js (not minified) 1,19 KB. :-) ... and you can take a look at the plugin code (http://snook.ca/technical/jquery-bg/jquery.bgpos.js) to understand how the programmer has achieved is purpose :-) Bye -- gianiaz.net - web solutions p.le bertacchi 66, 23100 sondrio (so) - italy +39 347 7196482
[jQuery] Re: jQuery Form Plugin - success callback problem with FF/Chrome
Hi Prajwala, thanks for your feedback! displayData(); ist not the problem as far as I've figured out, since it's not even executed. The problem is that displayData() is not called, even though the Ajax Request was executed successfully. Thanks to you "debugger" hint I was able to pinpoint the problem a bit further: The form, along with it's jQuery code ist not present within the page as it loads. Rather the whole code (form & jQuery stuff) is loaded via an Ajax request later on, as a single HTML part within the page is exchanged with the form. After loading the form the success callback won't be triggered, even though the jQuery.ready(); stuff is executed. onBeforeSubmit() callbacks won't work either under this specific circumstances. When reloading the page, all the contents are already present at load time, causing the whole thing to work without any problems. So the problem is somehow related to using jQuery().ready() when loading html fragments using Ajax after the whole page has finished loading. Whew... any hints someone? Thanks for your effort! Greets, Clemens
[jQuery] Re: Ajax Tabs and jqModal
http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_AJAX_request.3F If you choose to use rebinding, you would use the tabs load callback for that. $('#tabs > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' }, load: function(e, ui) { // rebind... $('a', ui.panel); // => all links inside loaded tab content } }); --Klaus On 30 Sep., 16:20, "Steffan A. Cline" <[EMAIL PROTECTED]> wrote: > I have a scenario where I am using the jQuery UI tabs via ajax. The problem > I am running into is that with this code: > $().ready(function() { > $('#tabs > ul').tabs({ fx: { height: 'toggle', opacity: 'toggle' } }); > $('#dialog').jqm({ajax: '@href', trigger: 'a.details'}); > }); > I am binding the jqmodal action to the existing links with the "details" > class BUT problem is that items loaded via ajax do not subsequently get > bound. Is there a trick to make jqmodal attach the links after each ajax > call has been done? > > Thanks > > Steffan > > --- > T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4 > Steffan A. Cline > [EMAIL PROTECTED] Phoenix, > Azhttp://www.ExecuChoice.net USA > AIM : SteffanC ICQ : 57234309 > YAHOO : Steffan_Cline MSN : [EMAIL PROTECTED] > GOOGLE: Steffan.Cline Lasso Partner Alliance Member > ---
[jQuery] R: [jQuery] Re: R: [jQuery] Show image gradually
Ciao Giovanni, some times it's good to understand the basic function of jQuery without using plugins..that's what i was trying to do :) if u never study u never lern!! regards Diego --- Mar 30/9/08, Giovanni Battista Lenoci <[EMAIL PROTECTED]> ha scritto: Da: Giovanni Battista Lenoci <[EMAIL PROTECTED]> Oggetto: [jQuery] Re: R: [jQuery] Show image gradually A: jquery-en@googlegroups.com Data: Martedì 30 settembre 2008, 17:08 Maybe you can take a look at this plugin, it seems that is what are you looking for: http://snook.ca/technical/jquery-bg/ bye -- gianiaz.net - web solutions p.le bertacchi 66, 23100 sondrio (so) - italy +39 347 7196482 Scopri il blog di Yahoo! Mail: Trucchi, novità e la tua opinione. http://www.ymailblogit.com/blog
[jQuery] Re: dealing with multiple forms having same id
for example if you bind something to that ID only the first one will work. so yeah i suggest either using classes or even prefixing the id so you can access them all with 1 selector $("div[id^=prefix_]") this is also similar to the valid CSS to style it (using selectors- but unfortunately it wont work in IE 6 and maybe not even in 7 cant rememver) On Sep 29, 11:02 pm, Donkeybob <[EMAIL PROTECTED]> wrote: > XHTML standards based development states that the id attribute must be > unique. So if you want you pages to have valid markup, use the class > attribute. > > from w3c: > - > id = ID > The id attribute assigns an identifier to an element. The value of > this attribute must be unique within a document. > > http://www.w3.org/TR/xhtml2/mod-core.html#adef_core_id > - > > On Sep 29, 3:03 pm, Amardeep <[EMAIL PROTECTED]> wrote: > > > HI Donkeybob > > > can u please tell me what do u mean by invalid page ? r u saying it wont be > > a valid HTML page ?? > > > On Mon, Sep 29, 2008 at 10:26 PM, Donkeybob <[EMAIL PROTECTED]> wrote: > > > as far as I know . . multiple id's is not allowed and would make your > > > page invalid. > > > > On Sep 29, 11:40 am, ♫ cheskonov <[EMAIL PROTECTED]> wrote: > > > > Hi, > > > > i am a new customer in jQuery so the following may sound stupid .. the > > > > problem i am facing is as bellow: > > > > I am working in a site where i am dealing with multiple forms having > > > > same id and every this .. all the forms contain some radio buttons (no > > > > of buttons may vary) and one submit button .. now how do i find out > > > > which submit button is clicked . all the submit buttons are also > > > > having the same id anb everything . any help please : > > > > > the html for my page is as follows : > > > > > > > > id="div_poll"> > > > > > > > > > > > > > > > > > > > type="hidden"> > > > > > > > > > > > > > > > > What's the best > > > > version of 'Zelda?' > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > Legend of Zelda > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > Majora's Mask > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > Twilight Princess > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > The Wind Waker > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > Ocarina of Time > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > The Minish Cap > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > class="form-submit legend_polls" onClick="$('#edit-current- > > > > nid').val('2015');return false;" type="submit"> > > > > > > > > > > > > > > > > > > > value="poll_view_voting" type="hidden"> > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > type="hidden"> > > > > > > > > > > > > > > > > Best search engine > > > h2> > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > google > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > yahoo > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > msn > > > > > > > > > > > > > > > > > > > > > > > > > > > type="radio"> > > > > AOL > > > > > > > > > > > > > > > >
[jQuery] Re: R: [jQuery] Show image gradually
Maybe you can take a look at this plugin, it seems that is what are you looking for: http://snook.ca/technical/jquery-bg/ bye -- gianiaz.net - web solutions p.le bertacchi 66, 23100 sondrio (so) - italy +39 347 7196482
[jQuery] R: [jQuery] Show image gradually
Always IE(fu#g browser) you have to add at the css rule #headernav ul li: position:relative; and it works with ie too diego --- Mar 30/9/08, diego valobra <[EMAIL PROTECTED]> ha scritto: Da: diego valobra <[EMAIL PROTECTED]> Oggetto: [jQuery] Show image gradually A: jquery-en@googlegroups.com Data: Martedì 30 settembre 2008, 16:51 Take a look at this.. http://www.pirolab.it/piro_09/slide.html http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> http://www.w3.org/1999/xhtml";> http://code.jquery.com/jquery-latest.js";> $(document).ready(function(){ //no slide effects added just pure jQuery $('#headernav ul li a').hover(function () { //start the hover function var slide = $(this).attr('title'); //a var that takes the attr title and change it in id value..'#'+slide means: #one or #two or #three $('#'+ slide).stop().animate({ //i stop animate function, so it does'nt repet over and over marginTop: '-30px' // i use marginTop to set the slide div going up }, 400); }, function() { var slide = $(this).attr('title'); $('#'+ slide).stop().animate({ //and to bring back the div at the mouseOut just give it the marginTop :'0'...that's it :) marginTop: '0px' },600); }); }); //if you take a look at the css you'll see that i've changed #headernav ul li, adding overflow:hidden.. so the span it' invisible :) #headernav { background: yellow url('images/navbg.gif') repeat-x; height: 30px; width:90%; } #headernav ul li { overflow:hidden; padding:0px; height:30px; text-align:center; line-height: 29px; display: inline; float: left; margin: 0px; } #headernav ul li span { background-color: green; border-bottom:0px solid green; width:120px; display: block; height:30px; position:relative; margin-left:0px; margin-top:0px; z-index:999 } #headernav ul li a { padding:0px; font-weight: bold; width:120px; height:30px; display:block; font-family: tahoma, arial; color: #000; position:relative; z-index:1000 } #headernav ul li a:hover { padding:0px; font-weight: bold;height:30px; display:block; font-family: tahoma, arial; color: #fff; position:relative; z-index:1001 } Home Support Contact Regards Diego --- Mar 30/9/08, yo2lux <[EMAIL PROTECTED]> ha scritto: Da: yo2lux <[EMAIL PROTECTED]> Oggetto: [jQuery] Re: R: [jQuery] R: [jQuery] Re: Show image gradually A: "jQuery (English)" Data: Martedì 30 settembre 2008, 15:19 Great! Thanks for your help! Is possible to change the direction ? Something like this menu : www.antena1.ro ? i need to start at bottom and show gradually until top. Now the script start at bottom but remove the color until top.. I need to start at bottom and add the color :) On Sep 30, 3:19 pm, diego valobra <[EMAIL PROTECTED]> wrote: > i had to change the css, actually does'nt work with ie > now works and is: > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> > http://www.w3.org/1999/xhtml";> > > http://code.jquery.com/jquery-latest.js";> > > > $(document).ready(function(){ //no slide effects added just pure jQuery > $('#headernav ul li a').hover(function () { //start the hover function > var slide = $(this).attr('title'); //a var that takes the attr title and change it in id value..'#'+slide means: #one or #two or #three > $('#'+ slide).stop().animate({ //i stop animate function, so it does'nt repet over and over > height: '0px' // i use width to set the slide div at 0px > }, 1500); > $('#'+ slide).queue(function(){ //an then after the event it's done i set by the queue function the div opacity at 0 > $('#'+ slide).css('opacity',0) > $('#'+ slide).dequeue(); > }); > }, > function() { > var slide = $(this).attr('title'); > $('#'+ slide).stop().animate({ //and to bring back the div at the mouseOut just give it the width:100px...that's it :) > height: '30px' > },1000); > $('#'+ slide).css('opacity',1) // i set the opacity at 1 > });}); > > > > #headernav { background: yellow url('images/navbg.gif') repeat-x; height: 30px; width:90%; } > #headernav ul li { padding:0px; height:30px; text-align:center; line-height: 29px; display: inline; float: left; margin: 0px; } > #headernav ul li span { background-color: green; width:120px; display: block; height:30px; position:relative; margin-left:0px; margin-top:-30px; z-index:999 } > #headernav ul li a { padding:0px; font-weight: bold; width:120px; height:30px; display:block; font-family: tahoma, arial; color: #fff; position:relative; z-index:1000 } > #headernav ul li a:hover { padding:0px; font-weight: bold;height:30px; display:block; font-family: tahoma, arial; color: #000; position:relative; z-index:1001 } > > > > > > > > Home > Support > Contact > > > > > > Ciao > > --- Mar 30/9/08, diego valobra <[EM
[jQuery] Re: querying an array
I was expecting this kind of answer ! :) Could you ignore the fact that it has to be unique, let's say I want to query on another attribute. And I want the query to limit the search to the elements in my Array. How do I do that ? On 30 sep, 15:37, BB <[EMAIL PROTECTED]> wrote: > An ID has to be uniq so you can just do that: > $("#headline").html(); > > On 30 Sep., 15:40, "[EMAIL PROTECTED]" > > <[EMAIL PROTECTED]> wrote: > > Hi, > > > I've build the following array using all the element in this.parent > > which have a class '.RepeatedItemElement' : > > > this.elements = $(".RepeatedItemElement", this.parent); > > > Now I want to query this array and get the innerHTML of the element > > which has id='headline'. I've tried the following: > > > var test = $(this.elements[id = "headline"]).html(); > > > but it doesn't work. > > > What is the correct way of doing this ? > > > Thanks
[jQuery] Show image gradually
Take a look at this.. http://www.pirolab.it/piro_09/slide.html http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> http://www.w3.org/1999/xhtml";> http://code.jquery.com/jquery-latest.js";> $(document).ready(function(){ //no slide effects added just pure jQuery $('#headernav ul li a').hover(function () { //start the hover function var slide = $(this).attr('title'); //a var that takes the attr title and change it in id value..'#'+slide means: #one or #two or #three $('#'+ slide).stop().animate({ //i stop animate function, so it does'nt repet over and over marginTop: '-30px' // i use marginTop to set the slide div going up }, 400); }, function() { var slide = $(this).attr('title'); $('#'+ slide).stop().animate({ //and to bring back the div at the mouseOut just give it the marginTop :'0'...that's it :) marginTop: '0px' },600); }); }); //if you take a look at the css you'll see that i've changed #headernav ul li, adding overflow:hidden.. so the span it' invisible :) #headernav { background: yellow url('images/navbg.gif') repeat-x; height: 30px; width:90%; } #headernav ul li { overflow:hidden; padding:0px; height:30px; text-align:center; line-height: 29px; display: inline; float: left; margin: 0px; } #headernav ul li span { background-color: green; border-bottom:0px solid green; width:120px; display: block; height:30px; position:relative; margin-left:0px; margin-top:0px; z-index:999 } #headernav ul li a { padding:0px; font-weight: bold; width:120px; height:30px; display:block; font-family: tahoma, arial; color: #000; position:relative; z-index:1000 } #headernav ul li a:hover { padding:0px; font-weight: bold;height:30px; display:block; font-family: tahoma, arial; color: #fff; position:relative; z-index:1001 } Home Support Contact Regards Diego --- Mar 30/9/08, yo2lux <[EMAIL PROTECTED]> ha scritto: Da: yo2lux <[EMAIL PROTECTED]> Oggetto: [jQuery] Re: R: [jQuery] R: [jQuery] Re: Show image gradually A: "jQuery (English)" Data: Martedì 30 settembre 2008, 15:19 Great! Thanks for your help! Is possible to change the direction ? Something like this menu : www.antena1.ro ? i need to start at bottom and show gradually until top. Now the script start at bottom but remove the color until top.. I need to start at bottom and add the color :) On Sep 30, 3:19 pm, diego valobra <[EMAIL PROTECTED]> wrote: > i had to change the css, actually does'nt work with ie > now works and is: > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> > http://www.w3.org/1999/xhtml";> > > http://code.jquery.com/jquery-latest.js";> > > > $(document).ready(function(){ //no slide effects added just pure jQuery > $('#headernav ul li a').hover(function () { //start the hover function > var slide = $(this).attr('title'); //a var that takes the attr title and change it in id value..'#'+slide means: #one or #two or #three > $('#'+ slide).stop().animate({ //i stop animate function, so it does'nt repet over and over > height: '0px' // i use width to set the slide div at 0px > }, 1500); > $('#'+ slide).queue(function(){ //an then after the event it's done i set by the queue function the div opacity at 0 > $('#'+ slide).css('opacity',0) > $('#'+ slide).dequeue(); > }); > }, > function() { > var slide = $(this).attr('title'); > $('#'+ slide).stop().animate({ //and to bring back the div at the mouseOut just give it the width:100px...that's it :) > height: '30px' > },1000); > $('#'+ slide).css('opacity',1) // i set the opacity at 1 > });}); > > > > #headernav { background: yellow url('images/navbg.gif') repeat-x; height: 30px; width:90%; } > #headernav ul li { padding:0px; height:30px; text-align:center; line-height: 29px; display: inline; float: left; margin: 0px; } > #headernav ul li span { background-color: green; width:120px; display: block; height:30px; position:relative; margin-left:0px; margin-top:-30px; z-index:999 } > #headernav ul li a { padding:0px; font-weight: bold; width:120px; height:30px; display:block; font-family: tahoma, arial; color: #fff; position:relative; z-index:1000 } > #headernav ul li a:hover { padding:0px; font-weight: bold;height:30px; display:block; font-family: tahoma, arial; color: #000; position:relative; z-index:1001 } > > > > > > > > Home > Support > Contact > > > > > > Ciao > > --- Mar 30/9/08, diego valobra <[EMAIL PROTECTED]> ha scritto: > Da: diego valobra <[EMAIL PROTECTED]> > Oggetto: [jQuery] R: [jQuery] Re: Show image gradually > A: jquery-en@googlegroups.com > Data: Martedì 30 settembre 2008, 14:07 > > Hi there, > I made some changes to the script, and now is: > > http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd";> > http://www.w3.org/1999/xht
[jQuery] Re: text() as a wrapped set?
You made me think about confusing the maintainers :) This would certainly do that but wouldn't break any code: $.fn._text = $.fn.text; $.fn.text = function( toTextNode ) { if( toTextNode === true ) return this.pushStack( [ document.createTextNode( this._text() ) ] ); return this._text(); } So you could do: $("a").text(true).appendTo("#sanbox"); and even $("a").text(true).end() would return $('a') On Sep 26, 3:17 pm, 703designs <[EMAIL PROTECTED]> wrote: > Oh, and break everything that depends on the text method. > > On Sep 26, 9:16 am, 703designs <[EMAIL PROTECTED]> wrote: > > > I could also do something along these lines: > > > $.fn.oldText = $.fn.text; > > $.fn.text = function() { > > return $(document.createTextNode(this.oldText())); > > > } > > > That is, of course, if I'd like to confuse the hell out of future > > maintainers :) > > > On Sep 25, 1:15 am, Balazs Endresz <[EMAIL PROTECTED]> wrote: > > > > I think the easiest way is to write another plugin: > > > > $.fn.$text=function(){ > > > return $( document.createTextNode( this.text() ) ) > > > > } > > > > $("a").$text().appendTo("#sanbox"); > > > > but you can extend the String prototype too: > > > > String.prototype.jqueryify=function(){ > > > return $( document.createTextNode( this ) ) > > > > } > > > > $('a').text().jqueryify().appendTo("#sanbox"); > > > > On Sep 24, 8:27 pm, 703designs <[EMAIL PROTECTED]> wrote: > > > > > Because the text method returns a string, it's missing appendTo and > > > > other methods. Now, of course I can do this: > > > > > $("#sandbox").text($("a").text()); > > > > > But I'd prefer to do this: > > > > > $("a").text().appendTo("#sanbox"); > > > > > What goes between text and appendTo? Or is the first example the best > > > > way to do this?
[jQuery] Re: querying an array
An ID has to be uniq so you can just do that: $("#headline").html(); On 30 Sep., 15:40, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I've build the following array using all the element in this.parent > which have a class '.RepeatedItemElement' : > > this.elements = $(".RepeatedItemElement", this.parent); > > Now I want to query this array and get the innerHTML of the element > which has id='headline'. I've tried the following: > > var test = $(this.elements[id = "headline"]).html(); > > but it doesn't work. > > What is the correct way of doing this ? > > Thanks
[jQuery] Re: select data in a ignoring the
Ok, how about something to the effect of: $("p").each(function() { $ (this).children(":not(span)").css({color:"red"}); }); On Sep 30, 8:12 am, [EMAIL PROTECTED] wrote: > If I do this with CLone then all my prossesing is with the clone but I > need to have a selector in the Original one not in the Clone so > changing and modifying the clone is not necessary ,the only way is get > a Clone of THe Span Then Remove the Span and then get the content of > the P do some changes on it , after that add the Span again And I > think this is not the right way to Deal with this ... > I'm still working on thiws and waiting for the best way to it > Thanks Pedram > > On Sep 30, 7:36 am, equallyunequal <[EMAIL PROTECTED]> wrote: > > > $("p:not(span)") would select all paragraphs that are not spans... > > which would be all paragraphs even if they have a child that is a > > span. > > $("p :not(span)") or $("p *:not(span)") would select all paragraphs > > without child spans... which would be none of the paragraphs. > > > He needs the contents of all paragraphs minus the content of a span. > > The only way (I can think of) to non-destructively get the contents of > > an element minus some of its children is to clone it first, then > > remove the children. > > > On Sep 29, 3:33 pm, dasacc22 <[EMAIL PROTECTED]> wrote: > > > > um cant you just do something like $("p:not(span)") ?? > > > > On Sep 28, 3:48 pm, equallyunequal <[EMAIL PROTECTED]> wrote: > > > > > This should work: > > > > > var clone = $("p").clone(); > > > > clone.find("span").remove(); > > > > > clone.each( function() { console.log(this) } ); > > > > > On Sep 28, 2:13 pm, [EMAIL PROTECTED] wrote: > > > > > > Hi Guys, > > > > > > this is the Code which I am working on > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > Data in a Span > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > Data in a Span > > > > > > > > > > > > > > > Data which I need to select and it hasn't an attribute > > > > > Data in a Span > > > > > > > > > > How could FIlter and Select the text Before the > > > > > does someone has an Idea ?
[jQuery] jquery game
Hello, I want to share my game, that I made when I was bored. This is web browser game similar to cubic rubic. I did not find such a game, so I named it Coloxy (color, x-axis, y-axis). Well, this is a logical game Cube-like game (or "The Magic of cubic RUBIC). In 5 boxes you have to make one kind of color. You need to use arrows around middle box, to move the lines. The game is made with php and jquery, so you need only a simple browser, without any flash / java and so on. If you will like it, digg it. Link to game: http://www.divile.com/game/
[jQuery] querying an array
Hi, I've build the following array using all the element in this.parent which have a class '.RepeatedItemElement' : this.elements = $(".RepeatedItemElement", this.parent); Now I want to query this array and get the innerHTML of the element which has id='headline'. I've tried the following: var test = $(this.elements[id = "headline"]).html(); but it doesn't work. What is the correct way of doing this ? Thanks