[jQuery] Re: jQuery in the wild
also www.bbc.co.uk On 24 Mar, 03:39, Benjamin Sterling [EMAIL PROTECTED] wrote: Looks like MLB.com and in turnhttp://phillies.comare now using jQuery 1.2.1, looks like they are using jcarousel and corners. -- Benjamin Sterlinghttp://www.KenzoMedia.comhttp://www.KenzoHosting.comhttp://www.benjaminsterling.com
[jQuery] Re: [ANNOUNCE] markItUp! 1.0 (former jTagEditor) is finally released!
nice !! dugg ! On Mon, Mar 24, 2008 at 4:56 AM, John Beppu [EMAIL PROTECTED] wrote: It looks nice. I'll have to try it out. On Sun, Mar 23, 2008 at 11:48 AM, Jay Salvat [EMAIL PROTECTED] wrote: Hi all! I'm proud to announce you the official release of markItUp! (former jTagEditor) and markItUp! website. I hope everything will be ok and i forgot nothing important. Website: http://markitup.jaysalvat.com/ Examples: http://markitup.jaysalvat.com/examples/ Feedbacks are welcomed! Jay S. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: Lazy load in IE7?
On Mar 22, 2008, at 3:53 PM, Jeroen Coumans wrote: I'm using the lazy load plugin from http://www.appelsiini.net/ projects/lazyload, but it doesn't seem to work properly in IE7. Some images load, others never finish loading. I tried playing with the failurelimit option but that doesn't affect it. Works great in Firefox and Safari 3 though. Anybody have an idea? Check http://jeroencoumans.nl/portfolio Sorry it took a while to answer. I cannot reproduce the problem with my IE7. Does problem occur to you in these demo pages too? http://www.appelsiini.net/projects/lazyload/enabled_gazillion.html http://www.appelsiini.net/projects/lazyload/enabled_fadein.html -- Mika Tuupola http://www.appelsiini.net/
[jQuery] [validate] validation works in firefox but not in IE
I have a form set up with the validator plugin (ver 1.2.1) and jquery(1.2.2) and the whole thing works perfectly in firefox 3b4, but when i fire up IE (any version) i get a alert box with the following message: Error: Expected Identifier, string or number. when i hit debug IE throws me to the postalcode definition in the rules section, and i can't figure out what might be going on here. There is no other javascript on the page. Thank you, Ariel my code follows: script src=lib/jquery.js type=text/javascript/script script src=lib/jquery.validate.js type=text/javascript/script script type=text/javascript jQuery.validator.addMethod(phone, function(value, element) { return this.optional(element) || value.match(/^\d{3}-\d{3}- \d{4}$/); }, Must be XXX-XXX-); jQuery.validator.addMethod(zip, function(value, element) { return this.optional(element) || value.match(/^((\d{5}-\d{4})| (\d{5})|([a-z]\d[a-z]\s?\d[a-z]\d))$/i); }, US or Canadian postal code only); $().ready(function(){ $(#leadForm).validate({ debug:true, rules: { firstname: required, lastname: required, phone: { required: true, phone: true, }, postalcode: { required:true, zip: true }, email: { required:true, email:true } }, messages: { firstname: required, lastname: required, phone:{ required: required, phone: XXX-XXX- }, postalcode:{ required: required, zip: Zip, Zip+4, or Canadian }, email:{ required: required, email: valid email required } } }) }); /script style type=text/css #leadForm label.error{ color:#FF } /style form action=?php echo $_SERVER['PHP_SELF'];? method=post id=leadForm table tr tdlabel for=firstnameFirst Name:/label/tdtdinput id=firstname name=firstname type=text maxlength=20 //td /tr tr tdlabel for=lastnameLast Name:/label/tdtdinput id=lastname name=lastname type=text maxlength=20 //td /tr tr tdlabel for=phonePhone:/label/tdtdinput id=phone name=phone type=text maxlength=20 //td /tr tr tdlabel for=postalcodePostal Code:/label/tdtdinput id=postalcode name=postalcode type=text maxlength=10 //td /tr tr tdlabel for=emailEmail:/label/tdtdinput id=email name=email type=text maxlength=80 //td /tr tr tdlabel for=besttimetocallBest Time To Call:/label/ tdtdselect name=besttimetocall id=besttimetocalloption value=1Morning/optionoption value=2Afternoon/optionoption value=3Evening/option/select/td /tr tr td/tdtdinput type=submit value=Submit name=submit // td /tr /table /form
[jQuery] Re: flexigrid plugin - help for server side script
This is a very nice plugin. It certainly would make a great addition to the UI libs if there aren't any issues with licensing. Is it a port from ExtJS? Btw I love the pager bar too!
[jQuery] Re: [ANNOUNCE] markItUp! 1.0 (former jTagEditor) is finally released!
fyi, on your html example page, if you select some text, click the Link icon, and Cancel it, an empty link is nevertheless added to the page. emichael
[jQuery] Re: Trouble with jQuery Expander
Thank you very much.
[jQuery] jQuery Newbie - Getting value of a Select Option
I'm a complete newbie to jQuery trying to perform a relatively simple task, but can't figure it out. Based of the value of a select option, I want to hide/show a div. How do I get the value of the select option? Here's what I have below. Thanks for your help! $(document).ready(function(){ var hearOther = $(#hear_other); hearOther.hide(); $(#hear).change(function(){ if( $(#hear_other option[value='O'])){ alert('show hearOther'); }else{ alert('hide hearOther'); } }); }); select id=hear option value=TTelevision/option option value=RRadio/option option value=OOther/option /select div id=hear_otherPlease describe ldquo;Otherrdquo;/div
[jQuery] nested Sortable Bug
Dear sir , I'm working with nested sortable Plugin http://plugins.jquery.com/project/NestedSortable the ploblem is this plugin only works with jQuery 1.1.3 and if I change the jQuery source file to 1.2.3 it only Drags the Items Once this Ploblem Accured in IE7 , I need this plugin badly in my projecty what is the solution has anyone worked with this Before !!!
[jQuery] nested Sortable Bug
Dear sir , I'm working with nested sortable Plugin http://plugins.jquery.com/project/NestedSortable the ploblem is this plugin only works with jQuery 1.1.3 and if I change the jQuery source file to 1.2.3 it only Drags the Items Once this Ploblem Accured in IE7 , I need this plugin badly in my projecty what is the solution has anyone worked with this Before !!! Regards Pedram
[jQuery] nested Sortable Bug!!!
Dear sir , I'm working with nested sortable Plugin http://plugins.jquery.com/project/NestedSortable the ploblem is this plugin only works with jQuery 1.1.3 and if I change the jQuery source file to 1.2.3 it only Drags the Items Once this Ploblem Accured in IE7 , I need this plugin badly in my projecty what is the solution has anyone worked with this Before !!! Regards Pedram
[jQuery] Superfish Plugin - transparency
In addition to my other question about Superfish I am also interested to know whether there is a way of making the submenus semi- transparent? If so how would I implement this in menu system where the background image of the a tag determines the colour of the background of the menu. Once again, thanks for any help.
[jQuery] nested Sortable Bug
Dear sir , I'm working with nested sortable Plugin http://plugins.jquery.com/project/NestedSortable the ploblem is this plugin only works with jQuery 1.1.3 and if I change the jQuery source file to 1.2.3 it only Drags the Items Once this Ploblem Accured in IE7 , I need this plugin badly in my projecty what is the solution has anyone worked with this Before !!!
[jQuery] Re: events on embedded SVG
Anyone? On Mar 23, 8:02 pm, zipman [EMAIL PROTECTED] wrote: Hello, I am having an html page and I embed an svg file through. object id=map data=/Demo/map.svg type=image/svg+xml height=500 width=600 /object or even embed id=map src=/Demo/map.svg type=image/svg+xml height=500 width=600 The problem is that I cannot access the elements inside the svg file through jquery. I can do htmlObj = document.getElementById(map); /*//this works only in IE SVGDoc = htmlObj.getSVGDocument();*/ //this works in firefox SVGDoc = htmlObj.contentDocument; and then access any element by getElementById eg when I want to access an elements with id=test I do it by SVGDoc.getElementById('test'); The problem is that the contents of the SVG are not appended to the DOM tree so methods like $('#test') do not work. Is there any way to make this work?
[jQuery] learning jquery book source code
i have downloaded the code source for learning jquery book but this code doesnt include all chapters in the book???
[jQuery] jEditable selects - Adding/binding events?
Hey all, I have the following jEditable which allows a user to change their mood: $(.mood-selector).editable(/user/mood, { data : {'happy':'happy','excited':'excited','lucky':'lucky','loving':'loving','selected':'? php print $moody; ?'}, type : select, submit : OK }); This works great, however I need to bind a click/change/mouseover event to the select that's generated by jEditable, so I can show a visual description of the option the user selects. I do not know how to get this operating with my jEditable. Has anyone tried this and can give me an idea?
[jQuery] Re: slideDown for a tr ignores the colspan
My suggestion would be to use div's instead of tables for this layout. div style=float:left;width:33%;stuff/div div style=float:left;width:33%;stuff/div div style=float:left;width:33%;stuff/div div style=clear:left;display:none id=expandmestuff/div Of course it would be better to have your CSS in a separate file rather than inline.
[jQuery] Problems with form plugin + response xml + tickbox
When I put the data of the form, it returns an XML if the information does not pass the validation. If the data is correct the response type is HTML. I'm using the Tickbox plugin to show this form. The problem is that if the response type is XML, i can't to call the success method of the Form plugin to manipulate the response. Someone could help me in this problem? Thanks
[jQuery] JQuery timer with reset option
Hi All, I'm very new at JQuery and have been messing about with a timer that will trigger a logout script on a page. what i'm trying to do is have a timer that counts down from lets say 10mins to 0 when it gets to zero it should call a function called logUserOut(). this works fine with a number of the timer examples out there (eg timer plugin) but i'm yet to find one that allows you to reset the time from an external function. once a user does certain things on the system i would like to restart the same timer from 10 mins. in the past I have used a tiny 1px x 1px iframe and refreshed the iframe whenever i needed to reset the timer. this worked fine but i thought there would be a more elegant way of doing it with JQuery. thanks in advance for your assistance. --etho
[jQuery] Re: Superfish Plugin - transparency
Hi Adrian, Hmm, this isn't pretty, but sort of does the job (see below). I set the animation to fade to opacity .92 which is only a subtle amount of transparency because deeper nested submenus will inherit this and apply their own further .92 amount, which could get hard to read. The onBeforeShow callback was needed to set initial values so that the fade-in worked. Like I said - it ain't perdy: $(document).ready(function(){ $(ul.nav) .superfish({ animation : { opacity:.92}, onBeforeShow : function() { $(this).css({ opacity :'.01', display : 'block' }); } }); });
[jQuery] Re: Superfish Plugin - Animation onmouseout
Superfish does not support animations on submenu close. I attempted it when I was first creating the plugin but ran into problems when the closing submenus were re-hovered. It may be easier to achieve now that stop() exists, but I haven't experimented with it yet. Maybe one day. Joel Birch.
[jQuery] Re: jEditable selects - Adding/binding events?
On Mar 24, 2008, at 12:12 PM, dgt wrote: Hey all, I have the following jEditable which allows a user to change their mood: ... This works great, however I need to bind a click/change/mouseover event to the select that's generated by jEditable, so I can show a visual description of the option the user selects. Do I understand correctly. You want to display something, for example a smiley somewhere in the html page according to what is selected in the select, but before submitting the value. Basically display something when onchange is triggered by select? -- Mika Tuupola http://www.appelsiini.net/
[jQuery] Re: markItUp! 1.0 (former jTagEditor) is finally released!
Wiki page is fixed, thanks. Insertion of element even if Cancel button has been clicked will be fixed in the next release. Thanks for your feedbacks and Diggs. Jay.
[jQuery] [validate] need help with addMethod
Trying to add a new validation method to check a yes/no set of radio buttons: My method: $.validator.addMethod(checkyesno, function(value) { if (value == 'Yes') { return true; } else { return false; } }, You must read and agree to the terms and conditions before proceeding.); My rules: rules: { terms: {required: true, checkyesno: true} }, But so far have not been able to make this work... What am I doing wrong?? Thanks! Jim
[jQuery] Re: markItUp! 1.0 (former jTagEditor) is finally released!
Can you clarify what the differences are between this and jTagEditor? Also... have you ever considered making a single image sprint of the buttons? That might save some load-time. Thanks for your work on this plugin, I use it quite a bit and very appreciative for it! Pax, - Stan On Mar 23, 2:48 pm, Jay Salvat [EMAIL PROTECTED] wrote: Hi all! I'm proud to announce you the official release of markItUp! (former jTagEditor) and markItUp! website. I hope everything will be ok and i forgot nothing important. Website:http://markitup.jaysalvat.com/ Examples:http://markitup.jaysalvat.com/examples/ Feedbacks are welcomed! Jay S.
[jQuery] Re: JQuery timer with reset option
Try the regular javascript setTimeout() function and see how that works for you. I choose to use that over any of the jquery timers I have seen. ethodaddy [EMAIL PROTECTED] wrote: Hi All, I'm very new at JQuery and have been messing about with a timer that will trigger a logout script on a page. what i'm trying to do is have a timer that counts down from lets say 10mins to 0 when it gets to zero it should call a function called logUserOut(). this works fine with a number of the timer examples out there (eg timer plugin) but i'm yet to find one that allows you to reset the time from an external function. once a user does certain things on the system i would like to restart the same timer from 10 mins. in the past I have used a tiny 1px x 1px iframe and refreshed the iframe whenever i needed to reset the timer. this worked fine but i thought there would be a more elegant way of doing it with JQuery. thanks in advance for your assistance. --etho - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
[jQuery] Re: CSS dynamic loading
Thanks! but this plugin throws an error too. Seems like there is no easy way to find out when css is loaded... =/ 2008/3/22, Ariel Flesler [EMAIL PROTECTED]: Not exactly what you said, but it's related to the rules you mentioned. Rule: http://flesler.blogspot.com/2007/11/jqueryrule.html -- Максим Игоревич Гришаев, AstroStar.ru
[jQuery] Re: markItUp! 1.0 (former jTagEditor) is finally released!
hi Jay, i'm trying to use markitup but it seems it embeds the markup twice: the starting html: fieldset ol li class=clearfix label for=descriptionShort Description:/label textarea name=description class=markItUp id=description style=float:none;display:block;width:100%;margin:auto;padding:0/textarea /li /ol /fieldset the generated source: fieldset ol li class=clearfix label for=descriptionShort Description:/label span class=div id=description class=markItUpdiv class=markItUpContainerdiv class=markItUpHeaderulli class=markItUpButton markItUpButton1a href=# accesskey= title=undefined/a/li/ul/divspan class=div id= class=markItUpdiv class=markItUpContainerdiv class=markItUpHeaderulli class=markItUpButton markItUpButton1a href=# accesskey= title=undefined/a/li/ul/divtextarea name=description class=markItUp markItUpEditor id= style=margin: auto; padding: 0pt; float: none; display: block; width: 100%; height: 171px;/textareadiv class=markItUpFooterdiv class=markItUpResizeHandle/div/div/div/div/spandiv class=markItUpFooterdiv class=markItUpResizeHandle/div/div/div/div/span /li /ol /fieldset The call to the function is a simple $(textarea.markItUp).markItUp(); Am i doing something wrong? On Mon, Mar 24, 2008 at 2:59 PM, Jay Salvat [EMAIL PROTECTED] wrote: Wiki page is fixed, thanks. Insertion of element even if Cancel button has been clicked will be fixed in the next release. Thanks for your feedbacks and Diggs. Jay. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Re: markItUp! 1.0 (former jTagEditor) is finally released!
i think i've found the cullprit: it does not play well with the jscrollpane plugin. If i remove jscrollpane, then it does not double the tag. That's weird because on my page, jscrollpane doesn't touch the textarea. i'll set up a test page to show it later today maybe you'll be able to find a fix ? On Mon, Mar 24, 2008 at 5:51 PM, Alexandre Plennevaux [EMAIL PROTECTED] wrote: hi Jay, i'm trying to use markitup but it seems it embeds the markup twice: the starting html: fieldset ol li class=clearfix label for=descriptionShort Description:/label textarea name=description class=markItUp id=description style=float:none;display:block;width:100%;margin:auto;padding:0/textarea /li /ol /fieldset the generated source: fieldset ol li class=clearfix label for=descriptionShort Description:/label span class=div id=description class=markItUpdiv class=markItUpContainerdiv class=markItUpHeaderulli class=markItUpButton markItUpButton1a href=# accesskey= title=undefined/a/li/ul/divspan class=div id= class=markItUpdiv class=markItUpContainerdiv class=markItUpHeaderulli class=markItUpButton markItUpButton1a href=# accesskey= title=undefined/a/li/ul/divtextarea name=description class=markItUp markItUpEditor id= style=margin: auto; padding: 0pt; float: none; display: block; width: 100%; height: 171px;/textareadiv class=markItUpFooterdiv class=markItUpResizeHandle/div/div/div/div/spandiv class=markItUpFooterdiv class=markItUpResizeHandle/div/div/div/div/span /li /ol /fieldset The call to the function is a simple $(textarea.markItUp).markItUp(); Am i doing something wrong? On Mon, Mar 24, 2008 at 2:59 PM, Jay Salvat [EMAIL PROTECTED] wrote: Wiki page is fixed, thanks. Insertion of element even if Cancel button has been clicked will be fixed in the next release. Thanks for your feedbacks and Diggs. Jay. -- Alexandre Plennevaux LAb[au] http://www.lab-au.com -- Alexandre Plennevaux LAb[au] http://www.lab-au.com
[jQuery] Using a button that doesn't submit?
Hi, all... I'm using some jQuery to add file fields to a page. I'm using a button to trigger the jQuery. buttonAdd New Image Field/button In IE6 and IE7 the button just adds fields like I want, however, in FF2, the button submits the form. How can I use the button with form submission? I found plenty of info on Google about submitting a form without a button, nothing on using a button in a form with causing submission... Rick
[jQuery] Re: Using a button that doesn't submit?
If you're already using jQuery just return false on the submit method for the form. $('#myFormID').submit(function(){ // do stuff here return false; }); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Faircloth Sent: Monday, March 24, 2008 12:15 PM To: jquery-en@googlegroups.com Subject: [jQuery] Using a button that doesn't submit? Hi, all... I'm using some jQuery to add file fields to a page. I'm using a button to trigger the jQuery. buttonAdd New Image Field/button In IE6 and IE7 the button just adds fields like I want, however, in FF2, the button submits the form. How can I use the button with form submission? I found plenty of info on Google about submitting a form without a button, nothing on using a button in a form with causing submission... Rick
[jQuery] Re: learning jquery book source code
On Mar 24, 2008, at 6:45 AM, tetrix wrote: i have downloaded the code source for learning jquery book but this code doesnt include all chapters in the book??? it /should/ include all chapters. Note that chapters 7-9 are in a directory called bookstore You can also see all the code functioning at http://book.learningjquery.com/ --Karl _ Karl Swedberg www.englishrules.com www.learningjquery.com
[jQuery] Re: [ANNOUNCE] markItUp! 1.0 (former jTagEditor) is finally released!
Hi Jay, Great script! I think that your menu has the dancing syndrome. I recently discovered the fix for this from Remy Sharp's post coda bubble. Its untested, but the following should fix it, or at least, you'll get the point: -Olivier hideDelayTimer = null; $(.menu a).hover(function() { if (hideDelayTimer) clearTimeout(hideDelayTimer); $(em, this).text($(this).attr(title)); $(em, this).not(':animated').animate({opacity: show, left: +20}, slow); $(this).not(':animated').animate({left: +20}, fast); }, function() { if (hideDelayTimer) clearTimeout(hideDelayTimer); hideDelayTimer = setTimeout(function (){ $(em, this).animate({opacity: hide, left: -20}, slow); $(this).animate({left: 0}, fast); }, 250); }); Jay Salvat wrote: Hi all! I'm proud to announce you the official release of markItUp! (former jTagEditor) and markItUp! website. I hope everything will be ok and i forgot nothing important. Website: http://markitup.jaysalvat.com/ Examples: http://markitup.jaysalvat.com/examples/ Feedbacks are welcomed! Jay S.
[jQuery] Re: Using a button that doesn't submit?
I tried inserting a return false; into my jQuery below, but it prevented the button from functioning as it needs. Here's the jQuery: $(document).ready(function() { $('#add-image').click(function() { $('#image-next').clone(true). attr('name', function() { return this.name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .insertAfter('#image-div :last'); }); }); And here's the button HTML: button id=add-imageAdd New Image Field/button Got any ideas on how I could modify this? I was using a link to add the file fields, but the link was refreshing the page and taking me back to the top of the page. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andy Matthews Sent: Monday, March 24, 2008 1:19 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Using a button that doesn't submit? If you're already using jQuery just return false on the submit method for the form. $('#myFormID').submit(function(){ // do stuff here return false; }); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Faircloth Sent: Monday, March 24, 2008 12:15 PM To: jquery-en@googlegroups.com Subject: [jQuery] Using a button that doesn't submit? Hi, all... I'm using some jQuery to add file fields to a page. I'm using a button to trigger the jQuery. buttonAdd New Image Field/button In IE6 and IE7 the button just adds fields like I want, however, in FF2, the button submits the form. How can I use the button with form submission? I found plenty of info on Google about submitting a form without a button, nothing on using a button in a form with causing submission... Rick
[jQuery] Treeview +/- icons not clickable
treeview 1.2.3 jquery 1.4 My +/- icons are inert. Users must click on text to expand/collapse the tree. http://www.scooterworks.com
[jQuery] Re: JQuery timer with reset option
Here's a page timer I'm using - right now it's set to 15 seconds and displays the current count every second in a div with id timer. There's probably a more elegant solution, but this can at least be a start. The key is clearing the setTimeout function when the timer gets reset, as just setting the setTimeout function again won't stop the previous timer but start a new instance. My code: - /** * When the document is ready, start the timer (startTimer();) and * bind all mouse movement to resetTimer(); */ $(document).ready(function() { startTimer(); $(window).bind(mousemove, function() { resetTimer(); }); }); /** * Some vital global variables for the timer */ var timerId = 0; var counterId = 0; /** * Start the timer */ function startTimer() { alertTimerId= setTimeout('refreshPage()', 15000); updateCounter('15'); } /** * Reset the Timer */ function resetTimer() { clearTimeout ( alertTimerId ); clearTimeout ( counterId ); startTimer(); } /** * Refresh the Page */ function refreshPage() { var sURL = unescape(window.location.pathname); window.location.replace( sURL ); } /** * Update the on-page Counter */ function updateCounter(count) { count = count - 1; $('#timer').html(count); counterId = setTimeout('updateCounter(\''+count+'\')', 1000); }
[jQuery] Problem with Tooltip + select
Hi, I am with a simple problem using plugin tooltip. I apply the tooltip in selectbox. If mouse step in selectbox still closed it works perfectly, but when I click on the mouse selectbox and step through options, the property TOP of the DIV tag decreases so that the tooltip is out of the select. Thanks!
[jQuery] div X, Y Location
Is there an easy way to find the current X, Y location of any div area? Example of what I am trying to find: $(this).xpage or $(#mainDiv).ypage Those currently returns undefined. What am I missing? Thanks.
[jQuery] Combine two jQuery objects
Hello all, I have the following code (which does not work) var childElmts; if (prntElmtID == 'P30_DESKTOP') { childElmts = $ (#P30_DESKTOP_ADD,label[for='P30_DESKTOP_ADD']); } else { childElmts = $ (#P30_LAPTOP_ADD,label[for='P30_LAPTOP_ADD']); childElmts += $(#P30_LT_OPTIONS).parent(td).children(); } How can I accomplish what I'm trying to do in the else block? Dan
[jQuery] MIssing cursor(caret) for input and textarea
Hi, I have a funny problem. I have several Divs showing and hiding as inline alerts, confirms and other forms. When showing, sometimes the inputs and the textareas do not show the blinking text cursor (the caret). Does anyobdy knows a workaround ? This is an issue not just w/ jQuery but w/ YUI too.
[jQuery] innerHTML from ajax req in IE
Using $load/get/ajax and innerHTML= or $().html for setting the content of the tab div tag works everywhere except IE6 (haven't tested IE7 as only ie6 is allowed on our boxes). The content works fine when inserted into the page with tiles before it is sent to the browser, but when the content page is switched using tabs with ajax, the content is returned from the server properly, but gets ruined when it is inserted into the dom. The tags are converted to uppercase, some double quotes are ignored, and these jQuery1206582151=47 attributes get added to certain tags. The page falls apart basically. Any ideas on why this is happening, and how to fix it. I've tried different file char formats, different jQuery functions for getting and setting the content, and nothing seems to work., thanks...
[jQuery] Re: Testing to see if a checkbox is checked
Erik, Both worked great, thank you very much! Dan On Mar 19, 9:37 pm, Erik Beeson [EMAIL PROTECTED] wrote: Try: $(...).is(:checked) Also, you can set the value attribute with .val(new value) --Erik On 3/19/08, Dan M [EMAIL PROTECTED] wrote: All, Hello all. I'm having an issue with an application that was working previously. I have some checkboxes which I use to hide/show other items on the page. I was using the following code to achieve this... if (jPrnt.attr(checked)) { actionLabelElmt.show(normal); actionElmt.show(normal); } else { actionLabelElmt.hide(normal); actionElmt.hide(normal); actionElmt.attr(value, '-1'); } This is no longer working... Any ideas on how to see if a checkbox is checked or unchecked after a page has been rendered but not submitted? Dan
[jQuery] Problems getting timing of commands to happen correctly
Hi everyone, I have been trying to use jQuery to create a relatively simple image rotator. The challenge I ran into with this script is that I want the new image to fade-in over top of the existing image. After many different attempts, I was able to get pretty close by using the following (unelegant) code: i++; bg++; if (i == (numImages + 1)) { i = i - numImages; } if (bg == (numImages +1 )) { bg = bg - numImages; } bgImg = url(/images/stories/js_images_home/header_ + bg + .jpg); img = 'img id=gallery src=/images/stories/js_images_home/ header_' + i + '.jpg/'; $ ('#header_gallery').css(backgroundImage,bgImg).html(img).find('img:eq(0)').fadeIn(3000).fadeTo(3000,1).fadeOut(4000,runHomePg); When I run the code, it works partially. From what I can tell, I am doing something wrong in trying to queue the effects . Right now, setting the CSS background-image and the fading in out of the foreground image happen simultaneously instead of sequentially like I want them to. Any help would be greatly appreciated... Steve
[jQuery] accessing elements with . in their ids without escaping
hello, I am in the process of moving to jQuery. One challenge is: many of the relevant IDs of Elements have one or more dots within them. I read within the FAQ that I can escape them when using the $(#some\ \.id) selector. Is there another possible way, like $().getelementbyid(#123.123) ? or is there an escaping-function allready in the wild? Or do I have to come up with my own escaping function? Best wishes Harald
[jQuery] Tabs, AJAX, and wanting to degrade safely
I currently use the jQuery tabs plugin for displaying a static website I am working on. Since it's small, I initially just put the four pages together on one page and let the tabs plugin do its work as scheduled. Now, it's getting bigger and loading more and more, therefore making the whole experience slower to load. I already know that the tabs plugin can load external pages via AJAX, which just loads the pages from regular anchor links within the tabs. So, here's my problem. To have the pages external, I would pretty much just cut-and-paste the contents of that tab into a new HTML file and have it load externally. But how should I have it degrade? Having JS disabled is a distinct possibility with this website (running off a CD + MSIE), so I should ideally have the pages link to each other with identical headers/footers as the website originally was. However, taking this approach would have multiple headers and footers. How should I go about this? For a more visual approach, check out the following: Old Site: |__ index.html |__ page1.html |__ page2.html |__ page3.html |__ page4.html All five pages have duplicated headers and footers, save for the tab bar which has static selected classes. They link to each of the other four pages. New Site: (Bulgy, slow) |__ index.html -|-- Header -|-- Tabs -|-- Contents of home -|-- Contents of page 1 (hidden by JS on default) -|-- Contents of page 2 (hidden by JS on default) -|-- Contents of page 3 (hidden by JS on default) -|-- Contents of page 4 (hidden by JS on default) -|-- Footer New ideas: (Fast, speedy, and good-looking) |__ index.html -|-- Header -|-- Tabs, links to pages -|-- Contents of home -|-- DIV container, loads others |__ page1.html |__ page2.html |__ page3.html |__ page4.html -|-- Footer
[jQuery] How do you restore the defaultValue of select element after a change event?
I have a select which pops a modal (with blockUI) input when a select is changed. The modal is an Ajax mini-form with an update and a cancel. The update works great but for cancel I need to be able to roll back the change() to the selection or else it appears from the user's perspective that it changed. I can't figure it out without going to a hacky hardcoded solution. $(.myType).change(function(){ // ... installing all my stuff; everything works // except reverting to selection before onchange }); I've played around with $(this).attr(defaultValue) and $(this) [0].defaultValue but the select elements appear to have no defaultValue (in tests too). Ideas?
[jQuery] Re: accessing elements with . in their ids without escaping
I haven't tested this, but try $( document.getElementById('123.123') ) Also note that according to the specification IDs must start with a letter ([a-zA-Z])... It sounds like even changing a period is difficult enough so this might be a similarly difficult task given your code/data. I remember (only vaguely) in some situations that deviating from the ID spec causes issues. Good luck! http://www.w3.org/TR/html401/types.html#type-name Brian. On Mon, Mar 24, 2008 at 11:00 AM, Harald Armin Massa [EMAIL PROTECTED] wrote: hello, I am in the process of moving to jQuery. One challenge is: many of the relevant IDs of Elements have one or more dots within them. I read within the FAQ that I can escape them when using the $(#some\ \.id) selector. Is there another possible way, like $().getelementbyid(#123.123) ? or is there an escaping-function allready in the wild? Or do I have to come up with my own escaping function? Best wishes Harald
[jQuery] Re: div X, Y Location
Are you looking for offset ? http://docs.jquery.com/CSS/offset Brian. On Mon, Mar 24, 2008 at 10:54 AM, Legster [EMAIL PROTECTED] wrote: Is there an easy way to find the current X, Y location of any div area? Example of what I am trying to find: $(this).xpage or $(#mainDiv).ypage Those currently returns undefined. What am I missing? Thanks.
[jQuery] Re: MIssing cursor(caret) for input and textarea
Do you have any sample/simplified code you could share? Also, what browser is this happening in? Brian. On Mon, Mar 24, 2008 at 9:49 AM, Kaloyan Tsvetkov [EMAIL PROTECTED] wrote: Hi, I have a funny problem. I have several Divs showing and hiding as inline alerts, confirms and other forms. When showing, sometimes the inputs and the textareas do not show the blinking text cursor (the caret). Does anyobdy knows a workaround ? This is an issue not just w/ jQuery but w/ YUI too.
[jQuery] Can't assign variable content to some element border color in IE (very weird problem)
Hi there, I'm having this strange problem with IE that I don't know how to fix. Tried countless things, but neither worked and I just can't understand why this is happening, it makes no sense to me. First things first... To assign a color to some element border I do the following which works fine: $('id#element').css('borderColor', '#ff'); Now let's say I have a variable with that string, something like this that also works fine: var color = '#ff'; $('id#element').css('borderColor', color); Now the real problem. On my original code, I have something like the above example, the only difference is that the color variable is not manually assigned like in the example. I have a function that grabs some colors from an external stylesheet, puts them into an array and returns the array. That function is called getColorsFromCSS and the code is the following: getColorsFromCSS: function(cssElement) { var cssRules, cssSelector; var colors = []; // Which CSS rules are available in the browser? if (document.styleSheets[0].cssRules) { cssRules = document.styleSheets[0].cssRules; } else { cssRules = document.styleSheets[0].rules; } // Double check if the CSS rules are really available if (cssRules) { // Loops through each CSS selector for (var i = 0; i cssRules.length; i++) { cssSelector = cssRules[i].selectorText.toLowerCase(); // Get colors from which CSS elements? if (cssElement == 'links') { // Gets the color value for a specific selector switch (cssSelector.replace(/,.+/i, )) { case ul#cp-block-items a:link: colors[0] = cssRules[i].style.color; break; case ul#cp-block-items a:hover: colors[1] = cssRules[i].style.color; break; case div#content a:link: colors[2] = cssRules[i].style.color; break; case div#content a:hover: colors[3] = cssRules[i].style.color; break; } // if(colors.length == 4) return colors; } else if (cssElement.indexOf('popup') == 0) { // Gets the color value for a specific selector switch (cssSelector.replace(/,.+/i, )) { case div# + cssElement: colors[0] = cssRules[i].style.color; colors[1] = cssRules[i].style.backgroundColor; break; } // if(colors.length == 2) return colors; } } } }, Yes, the function is working, meaning the values are retrieved from the external CSS and the array is returned with all the values inside it. I conformed this by doing an alert(popupColors[0]); before trying to set the border color and the output was a string with the color value (like the code below). And my real code goes like this: var popupColors = $.admin.getColorsFromCSS('popup-notice-error'); alert(popupColors[0]); // This outputs the color value assigned to this array index $('div#popup-block').css('borderColor', popupColors[0]); // But this doesn't work :( This is only happening in IE6/7, not on Firefox 2.0.0.12, Opera 9.26 and Safari 3.1 (Win). Any thoughts on this?
[jQuery] Re: Tabs, AJAX, and wanting to degrade safely
Hi, I have not understood your examples, but the classical approach with ajax, from a server side point of view, is to send the content of the page with header and footer if it is an http request and to send only the content if it is ajax. I think that you can detect an ajax call from the headers of the request, alternatively you can just add an ajax parameter to all your ajax calls and use it as a boolean on the serverside to decide what you have to sent, e.g, with or without header and footer. -Olivier zwaldowski wrote: I currently use the jQuery tabs plugin for displaying a static website I am working on. Since it's small, I initially just put the four pages together on one page and let the tabs plugin do its work as scheduled. Now, it's getting bigger and loading more and more, therefore making the whole experience slower to load. I already know that the tabs plugin can load external pages via AJAX, which just loads the pages from regular anchor links within the tabs. So, here's my problem. To have the pages external, I would pretty much just cut-and-paste the contents of that tab into a new HTML file and have it load externally. But how should I have it degrade? Having JS disabled is a distinct possibility with this website (running off a CD + MSIE), so I should ideally have the pages link to each other with identical headers/footers as the website originally was. However, taking this approach would have multiple headers and footers. How should I go about this? For a more visual approach, check out the following: Old Site: |__ index.html |__ page1.html |__ page2.html |__ page3.html |__ page4.html All five pages have duplicated headers and footers, save for the tab bar which has static selected classes. They link to each of the other four pages. New Site: (Bulgy, slow) |__ index.html -|-- Header -|-- Tabs -|-- Contents of home -|-- Contents of page 1 (hidden by JS on default) -|-- Contents of page 2 (hidden by JS on default) -|-- Contents of page 3 (hidden by JS on default) -|-- Contents of page 4 (hidden by JS on default) -|-- Footer New ideas: (Fast, speedy, and good-looking) |__ index.html -|-- Header -|-- Tabs, links to pages -|-- Contents of home -|-- DIV container, loads others |__ page1.html |__ page2.html |__ page3.html |__ page4.html -|-- Footer
[jQuery] Re: accessing elements with . in their ids without escaping
If you have the raw (ie blah.blah) you could just alias the document.getElementById function: function getId( id ) { return document.getElementById( id ); } Or if you have the ids in CSS form (ie #blah.blah): function getId( id ) { return document.getElementById( id.substr(1) ); } And then use it like: $( getId( 'blah.blah' ) )... Karl Rudd On Tue, Mar 25, 2008 at 5:00 AM, Harald Armin Massa [EMAIL PROTECTED] wrote: hello, I am in the process of moving to jQuery. One challenge is: many of the relevant IDs of Elements have one or more dots within them. I read within the FAQ that I can escape them when using the $(#some\ \.id) selector. Is there another possible way, like $().getelementbyid(#123.123) ? or is there an escaping-function allready in the wild? Or do I have to come up with my own escaping function? Best wishes Harald
[jQuery] Re: Combine two jQuery objects
I think you're looking for .add(). Try this: var childElmts = $('#P30_DESKTOP_ADD, label[for=P30_DESKTOP_ADD]'); if(prntElmtID != 'P30_DESKTOP') childElmts.add( $('#P30_LT_OPTIONS').parent('td').children() ); - jason On Mar 24, 11:43 am, Dan M [EMAIL PROTECTED] wrote: Hello all, I have the following code (which does not work) var childElmts; if (prntElmtID == 'P30_DESKTOP') { childElmts = $ (#P30_DESKTOP_ADD,label[for='P30_DESKTOP_ADD']); } else { childElmts = $ (#P30_LAPTOP_ADD,label[for='P30_LAPTOP_ADD']); childElmts += $(#P30_LT_OPTIONS).parent(td).children(); } How can I accomplish what I'm trying to do in the else block? Dan
[jQuery] Re: Problems getting timing of commands to happen correctly
You want to place each subsequent effect within the callback function of the previous effect, i.e.: $('YOUR_ITEM').EFFECT1(function(){ $(this).EFFECT2(function(){ $(this).EFFECT3(function(){ ...and so on... }); }); }); - jason On Mar 24, 12:25 pm, Steve Reichgut [EMAIL PROTECTED] wrote: Hi everyone, I have been trying to use jQuery to create a relatively simple image rotator. The challenge I ran into with this script is that I want the new image to fade-in over top of the existing image. After many different attempts, I was able to get pretty close by using the following (unelegant) code: i++; bg++; if (i == (numImages + 1)) { i = i - numImages; } if (bg == (numImages +1 )) { bg = bg - numImages; } bgImg = url(/images/stories/js_images_home/header_ + bg + .jpg); img = 'img id=gallery src=/images/stories/js_images_home/ header_' + i + '.jpg/'; $ ('#header_gallery').css(backgroundImage,bgImg).html(img).find('img:eq(0)').fadeIn(3000).fadeTo(3000,1).fadeOut(4000,runHomePg); When I run the code, it works partially. From what I can tell, I am doing something wrong in trying to queue the effects . Right now, setting the CSS background-image and the fading in out of the foreground image happen simultaneously instead of sequentially like I want them to. Any help would be greatly appreciated... Steve
[jQuery] Re: How do you restore the defaultValue of select element after a change event?
If your first option element has an empty value attribute, you can do this: $('select').change(function(){ alert($(this).val()); $(this).val(''); }); - jason On Mar 24, 2:16 pm, Ashley [EMAIL PROTECTED] wrote: I have a select which pops a modal (with blockUI) input when a select is changed. The modal is an Ajax mini-form with an update and a cancel. The update works great but for cancel I need to be able to roll back the change() to the selection or else it appears from the user's perspective that it changed. I can't figure it out without going to a hacky hardcoded solution. $(.myType).change(function(){ // ... installing all my stuff; everything works // except reverting to selection before onchange }); I've played around with $(this).attr(defaultValue) and $(this) [0].defaultValue but the select elements appear to have no defaultValue (in tests too). Ideas?
[jQuery] Re: div X, Y Location
Just use javascript: var x = this.offsetLeft; var y = this.offsetTop; Legster [EMAIL PROTECTED] wrote: Is there an easy way to find the current X, Y location of any div area? Example of what I am trying to find: $(this).xpage or $(#mainDiv).ypage Those currently returns undefined. What am I missing? Thanks. - Never miss a thing. Make Yahoo your homepage.
[jQuery] Re: accessing elements with . in their ids without escaping
this works, but maybe there is also an easier way out there somewhere- $([id='something.somethingelse']) On Mar 24, 2:00 pm, Harald Armin Massa [EMAIL PROTECTED] wrote: hello, I am in the process of moving to jQuery. One challenge is: many of the relevant IDs of Elements have one or more dots within them. I read within the FAQ that I can escape them when using the $(#some\ \.id) selector. Is there another possible way, like $().getelementbyid(#123.123) ? or is there an escaping-function allready in the wild? Or do I have to come up with my own escaping function? Best wishes Harald
[jQuery] Improvement
I'm relatively new to jQuery Javascript and was wondering if someone could help me condense my code a little. What I have going on is... multiple div's with different info in them an ordered list of links. Only one of the divs will display at a time and they can be toggled through by clicking on the corresponding link. HTML: div id=branding div id=one pLorem Ipsum One/p /div div id=two pLorem Ipsum Two/p /div div id=three pLorem Ipsum Thre/p /div ol lia href=/?brandingId=11/a/li lia href=/?brandingId=22/a/li lia href=/?brandingId=33/a/li /ol /div JQuery: $(#branding ol li:nth-child(1) a).click(function() { $(#branding div).attr('id', 'one'); }); $(#branding ol li:nth-child(2) a).click(function() { $(#branding div).attr('id', 'two'); }); $(#branding ol li:nth-child(3) a).click(function() { $(#branding div).attr('id', 'three'); }); Here is a quick demo page... http://demonstration.dev.matrixgroup.net/brad/toggle/ Thanks for any help, brad
[jQuery] Re: Problems getting timing of commands to happen correctly
Here's a good working example. This might help, but of course you will have to tweak the timing to suit your needs. http://2whoa.com/dominate/2008/03/jquery-fades.php Steve Reichgut [EMAIL PROTECTED] wrote: Hi everyone, I have been trying to use jQuery to create a relatively simple image rotator. The challenge I ran into with this script is that I want the new image to fade-in over top of the existing image. After many different attempts, I was able to get pretty close by using the following (unelegant) code: i++; bg++; if (i == (numImages + 1)) { i = i - numImages; } if (bg == (numImages +1 )) { bg = bg - numImages; } bgImg = url(/images/stories/js_images_home/header_ + bg + .jpg); img = 'header_'%20+%20i%20+%20'.jpg'; $ ('#header_gallery').css(backgroundImage,bgImg).html(img).find('img:eq(0)').fadeIn(3000).fadeTo(3000,1).fadeOut(4000,runHomePg); When I run the code, it works partially. From what I can tell, I am doing something wrong in trying to queue the effects . Right now, setting the CSS background-image and the fading in out of the foreground image happen simultaneously instead of sequentially like I want them to. Any help would be greatly appreciated... Steve - Be a better friend, newshound, and know-it-all with Yahoo! Mobile. Try it now.
[jQuery] Re: Tabs, AJAX, and wanting to degrade safely
However, taking this approach would have multiple headers and footers. How should I go about this? If you're using plain HTML then yes, you'll need to duplicate the header/footer data in the fall back pages. Do you have a database and/or server-side scripting language at your disposal? On Mar 25, 7:15 am, zwaldowski [EMAIL PROTECTED] wrote: I currently use the jQuery tabs plugin for displaying a static website I am working on. Since it's small, I initially just put the four pages together on one page and let the tabs plugin do its work as scheduled. Now, it's getting bigger and loading more and more, therefore making the whole experience slower to load. I already know that the tabs plugin can load external pages via AJAX, which just loads the pages from regular anchor links within the tabs. So, here's my problem. To have the pages external, I would pretty much just cut-and-paste the contents of that tab into a new HTML file and have it load externally. But how should I have it degrade? Having JS disabled is a distinct possibility with this website (running off a CD + MSIE), so I should ideally have the pages link to each other with identical headers/footers as the website originally was. However, taking this approach would have multiple headers and footers. How should I go about this? For a more visual approach, check out the following: Old Site: |__ index.html |__ page1.html |__ page2.html |__ page3.html |__ page4.html All five pages have duplicated headers and footers, save for the tab bar which has static selected classes. They link to each of the other four pages. New Site: (Bulgy, slow) |__ index.html -|-- Header -|-- Tabs -|-- Contents of home -|-- Contents of page 1 (hidden by JS on default) -|-- Contents of page 2 (hidden by JS on default) -|-- Contents of page 3 (hidden by JS on default) -|-- Contents of page 4 (hidden by JS on default) -|-- Footer New ideas: (Fast, speedy, and good-looking) |__ index.html -|-- Header -|-- Tabs, links to pages -|-- Contents of home -|-- DIV container, loads others |__ page1.html |__ page2.html |__ page3.html |__ page4.html -|-- Footer
[jQuery] Need help with a toggle - works if I click twice!
My code: div class=categorytitleHealth Status or Disease/div div class=topiccount 54 Topics span class=clicktoview- Click To View/span /div /div div class=topiclist div class=twocols ul li style=display: list-item; class=checkboxline input class=check value=1 name=topicid id=topic_1 type=checkbox label class=label for=topic_1Acute Lung Injury/label /li li style=display: list-item; class=checkboxline input class=check value=3 name=topicid id=topic_3 type=checkbox label class=label for=topic_3Agricultural Workers' Diseases/label /li /ul /div div class=twocols ul li style=display: list-item; class=checkboxline input class=check value=1 name=topicid id=topic_2 type=checkbox label class=label for=topic_2Something/label /li li style=display: list-item; class=checkboxline input class=check value=3 name=topicid id=topic_4 type=checkbox label class=label for=topic_4Something Else/label /li /ul /div /div My jQuery: $('div.topiccategory').toggle( function () { $(this).next().children().children().show(); }, function () { $(this).next().children().children('ul').children('li').children(':check box').not(':checked').parent().toggle(); }); This works - but I have to click on the category title twice! Argh! :) What am I doing wrong??? I've been tinkering around with it in Firebug but getting nowhere fast. Thanks! Jim
[jQuery] Can't grab text element
I have a web page that renders radio buttons with text after it. I want to take that text and wrap a label tag around it but I can't grab the text. Here is the HTML: input type=radio name=RadioField type=hidden value=YYes input type=radio name=RadioField type=hidden value=NNo I can get the radio object and I can get an array the radio objects siblings using (#radio).each( function(){ $(this).siblings ). I can't get the first sibling that's a text node. I've tried $ (this).siblings([nodeType=3]) but I don't get anything returned. I've also tried to loop through the siblings and see what the node type is but the return value is always undefined.
[jQuery] Re: validation works in firefox but not in IE
OK nevermind. after taking a break for a while and coming back, i immediately found the exra comma in there. although, in my defense, neither firebug nor webdeveloper toolbar fond the syntax error either. On Mar 23, 10:54 pm, Ariel [EMAIL PROTECTED] wrote: I have a form set up with the validator plugin (ver 1.2.1) and jquery(1.2.2) and the whole thing works perfectly in firefox 3b4, but when i fire up IE (any version) i get a alert box with the following message: Error: Expected Identifier, string or number. when i hit debug IE throws me to the postalcode definition in the rules section, and i can't figure out what might be going on here. There is no other javascript on the page. Thank you, Ariel my code follows: script src=lib/jquery.js type=text/javascript/script script src=lib/jquery.validate.js type=text/javascript/script script type=text/javascript jQuery.validator.addMethod(phone, function(value, element) { return this.optional(element) || value.match(/^\d{3}-\d{3}- \d{4}$/); }, Must be XXX-XXX-); jQuery.validator.addMethod(zip, function(value, element) { return this.optional(element) || value.match(/^((\d{5}-\d{4})| (\d{5})|([a-z]\d[a-z]\s?\d[a-z]\d))$/i); }, US or Canadian postal code only); $().ready(function(){ $(#leadForm).validate({ debug:true, rules: { firstname: required, lastname: required, phone: { required: true, phone: true, }, postalcode: { required:true, zip: true }, email: { required:true, email:true } }, messages: { firstname: required, lastname: required, phone:{ required: required, phone: XXX-XXX- }, postalcode:{ required: required, zip: Zip, Zip+4, or Canadian }, email:{ required: required, email: valid email required } } }) }); /script style type=text/css #leadForm label.error{ color:#FF} /style form action=?php echo $_SERVER['PHP_SELF'];? method=post id=leadForm table tr tdlabel for=firstnameFirst Name:/label/tdtdinput id=firstname name=firstname type=text maxlength=20 //td /tr tr tdlabel for=lastnameLast Name:/label/tdtdinput id=lastname name=lastname type=text maxlength=20 //td /tr tr tdlabel for=phonePhone:/label/tdtdinput id=phone name=phone type=text maxlength=20 //td /tr tr tdlabel for=postalcodePostal Code:/label/tdtdinput id=postalcode name=postalcode type=text maxlength=10 //td /tr tr tdlabel for=emailEmail:/label/tdtdinput id=email name=email type=text maxlength=80 //td /tr tr tdlabel for=besttimetocallBest Time To Call:/label/ tdtdselect name=besttimetocall id=besttimetocalloption value=1Morning/optionoption value=2Afternoon/optionoption value=3Evening/option/select/td /tr tr td/tdtdinput type=submit value=Submit name=submit // td /tr /table /form
[jQuery] Re: Superfish Plugin - Animation onmouseout
OK thanks for letting me know On Mar 24, 9:06 am, Joel Birch [EMAIL PROTECTED] wrote: Superfish does not support animations on submenu close. I attempted it when I was first creating the plugin but ran into problems when the closing submenus were re-hovered. It may be easier to achieve now that stop() exists, but I haven't experimented with it yet. Maybe one day. Joel Birch.
[jQuery] Re: How do you restore the defaultValue of select element after a change event?
On Mar 24, 3:08 pm, Jason Huck [EMAIL PROTECTED] wrote: If your first option element has an empty value attribute, you can do this: $('select').change(function(){ alert($(this).val()); $(this).val(''); }); I wish. The XHTML is written dynamically and the selected element is anywhere in the list. I'm playing with the defaultSelected property now. I think the answer is in there. I'll post a follow up when I figure it out.
[jQuery] Re: Using a button that doesn't submit?
The code you listed doesn't have the return false...Add the return false statement at the end of the .click() function like so... $(document).ready(function() { $('#add-image').click(function() { $('#image-next').clone(true).attr('name', function() { return this.name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .insertAfter('#image-div :last'); return false; }); }); if you want to use a link to do the same thing, the exact principles apply, add a return false statement to the click function. So if you had a link of: a href='#' id='add-image'Add New Image Field/a your script would look like this: $('#add-image').click(function(){ //your $image-next.clone code here... this.blur; //removes the focus from the link (basically removes that annoying dotted box). return false; //prevent link bubbling. }); On Mar 24, 3:07 pm, Rick Faircloth [EMAIL PROTECTED] wrote: I tried inserting a return false; into my jQuery below, but it prevented the button from functioning as it needs. Here's the jQuery: $(document).ready(function() { $('#add-image').click(function() { $('#image-next').clone(true). attr('name', function() { return this.name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .insertAfter('#image-div :last'); }); }); And here's the button HTML: button id=add-imageAdd New Image Field/button Got any ideas on how I could modify this? I was using a link to add the file fields, but the link was refreshing the page and taking me back to the top of the page. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andy Matthews Sent: Monday, March 24, 2008 1:19 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Using a button that doesn't submit? If you're already using jQuery just return false on the submit method for the form. $('#myFormID').submit(function(){ // do stuff here return false; }); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Faircloth Sent: Monday, March 24, 2008 12:15 PM To: jquery-en@googlegroups.com Subject: [jQuery] Using a button that doesn't submit? Hi, all... I'm using some jQuery to add file fields to a page. I'm using a button to trigger the jQuery. buttonAdd New Image Field/button In IE6 and IE7 the button just adds fields like I want, however, in FF2, the button submits the form. How can I use the button with form submission? I found plenty of info on Google about submitting a form without a button, nothing on using a button in a form with causing submission... Rick
[jQuery] [treeview] async treeview = reload branche...
I am using the async treeview to list all manageble elements on a site. This means that if the user edits an item and, for example, changes its title, this should reflect in the tree. Also moves and deletes should reflect in the tree. Because my forms get posted with ajax I need to update the tree myself. Is there a relativly easy way to reload one or more branches from server? B
[jQuery] grep with new version of jQuery 1.2.3
Here's a line of code that I had written that worked great with version 1.2.1: $.grep(priceBreaks, 'a quantity', true) How might I write this so that it works with version 1.2.3?
[jQuery] Re: How do you restore the defaultValue of select element after a change event?
Oh, duh. You mean whatever their last selection was prior to the change. Sorry! Can you pop each successful update into a global var, and then restore from that when they cancel? - jason On Mar 24, 6:22 pm, Ashley [EMAIL PROTECTED] wrote: On Mar 24, 3:08 pm, Jason Huck [EMAIL PROTECTED] wrote: If your first option element has an empty value attribute, you can do this: $('select').change(function(){ alert($(this).val()); $(this).val(''); }); I wish. The XHTML is written dynamically and the selected element is anywhere in the list. I'm playing with the defaultSelected property now. I think the answer is in there. I'll post a follow up when I figure it out.
[jQuery] Re: MIssing cursor(caret) for input and textarea
I have bug with disappearing caret and animation. I dont know is it same bug about Kaloyan Tsvetkov (Kaloyan Tsvetkov privet tebe is Vladivostoka ^_^) wrot. Please check sample file I made in this archive: http://poligon.farpost.com/df/mo_caret_bug.zip Brian Cherne: Do you have any sample/simplified code you could share? Also, what browser is this happening in?
[jQuery] Re: MIssing cursor(caret) for input and textarea
This is a known issue with Firefox and absolute positioned divs. There are some workarounds discussed here: https://bugzilla.mozilla.org/show_bug.cgi?id=167801 It's been a problem for years, and supposedly it will be fixed in version 3. -- Josh - Original Message - From: bazzzman [EMAIL PROTECTED] To: jQuery (English) jquery-en@googlegroups.com Sent: Monday, March 24, 2008 4:24 PM Subject: [jQuery] Re: MIssing cursor(caret) for input and textarea I have bug with disappearing caret and animation. I dont know is it same bug about Kaloyan Tsvetkov (Kaloyan Tsvetkov privet tebe is Vladivostoka ^_^) wrot. Please check sample file I made in this archive: http://poligon.farpost.com/df/mo_caret_bug.zip Brian Cherne: Do you have any sample/simplified code you could share? Also, what browser is this happening in?
[jQuery] Re: Can't grab text element
You could loop over the radio buttons using each() and get the next text node. Untested code follows: $(':radio').each( function() { $( this.nextSibling ).wrap( 'label/label' ); }); Karl Rudd On Tue, Mar 25, 2008 at 8:59 AM, Greg G [EMAIL PROTECTED] wrote: I have a web page that renders radio buttons with text after it. I want to take that text and wrap a label tag around it but I can't grab the text. Here is the HTML: input type=radio name=RadioField type=hidden value=YYes input type=radio name=RadioField type=hidden value=NNo I can get the radio object and I can get an array the radio objects siblings using (#radio).each( function(){ $(this).siblings ). I can't get the first sibling that's a text node. I've tried $ (this).siblings([nodeType=3]) but I don't get anything returned. I've also tried to loop through the siblings and see what the node type is but the return value is always undefined.
[jQuery] Re: Using a button that doesn't submit?
Thanks, motob... I had it in the wrong place. But now, it works! :o) Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of motob Sent: Monday, March 24, 2008 4:22 PM To: jQuery (English) Subject: [jQuery] Re: Using a button that doesn't submit? The code you listed doesn't have the return false...Add the return false statement at the end of the .click() function like so... $(document).ready(function() { $('#add-image').click(function() { $('#image-next').clone(true).attr('name', function() { return this.name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .insertAfter('#image-div :last'); return false; }); }); if you want to use a link to do the same thing, the exact principles apply, add a return false statement to the click function. So if you had a link of: a href='#' id='add-image'Add New Image Field/a your script would look like this: $('#add-image').click(function(){ //your $image-next.clone code here... this.blur; //removes the focus from the link (basically removes that annoying dotted box). return false; //prevent link bubbling. }); On Mar 24, 3:07 pm, Rick Faircloth [EMAIL PROTECTED] wrote: I tried inserting a return false; into my jQuery below, but it prevented the button from functioning as it needs. Here's the jQuery: $(document).ready(function() { $('#add-image').click(function() { $('#image-next').clone(true). attr('name', function() { return this.name.replace(/(.+)(\d+$)/, function(s, p1, p2) { return p1 + (parseInt(p2, 10) + 1); }) }) .insertAfter('#image-div :last'); }); }); And here's the button HTML: button id=add-imageAdd New Image Field/button Got any ideas on how I could modify this? I was using a link to add the file fields, but the link was refreshing the page and taking me back to the top of the page. Rick -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Andy Matthews Sent: Monday, March 24, 2008 1:19 PM To: jquery-en@googlegroups.com Subject: [jQuery] Re: Using a button that doesn't submit? If you're already using jQuery just return false on the submit method for the form. $('#myFormID').submit(function(){ // do stuff here return false; }); -Original Message- From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of Rick Faircloth Sent: Monday, March 24, 2008 12:15 PM To: jquery-en@googlegroups.com Subject: [jQuery] Using a button that doesn't submit? Hi, all... I'm using some jQuery to add file fields to a page. I'm using a button to trigger the jQuery. buttonAdd New Image Field/button In IE6 and IE7 the button just adds fields like I want, however, in FF2, the button submits the form. How can I use the button with form submission? I found plenty of info on Google about submitting a form without a button, nothing on using a button in a form with causing submission... Rick
[jQuery] IE re-applies percentage widths on each event.
Hi all, I'm trying to finish up a little plugin to create a sortable combo- select input from a single select input. It works great in Firefox, Safari, and Opera, but in IE (any version), every time you move an option, the select inputs decrease in width, until they completely disappear. It looks like maybe it's re-applying the percentage width within the current width each time. This seems really odd to me since I'm not manipulating the styles of these elements in any way. If I switch to fixed pixel widths in the CSS, it's fine. I was just trying to make the default CSS as flexible as possible. Here's an example: http://devblog.jasonhuck.com/assets/comboselect_plugin/ Any thoughts? Thanks, Jason
[jQuery] Re: Can't assign variable content to some element border color in IE (very weird problem)
Anyone please... This is really making me mad and I have no clue on how to fix this stupid bug that shouldn't be happening. If anyone as any idea, please, let me now... :( Nazgulled wrote: Hi there, I'm having this strange problem with IE that I don't know how to fix. Tried countless things, but neither worked and I just can't understand why this is happening, it makes no sense to me. First things first... To assign a color to some element border I do the following which works fine: $('id#element').css('borderColor', '#ff'); Now let's say I have a variable with that string, something like this that also works fine: var color = '#ff'; $('id#element').css('borderColor', color); Now the real problem. On my original code, I have something like the above example, the only difference is that the color variable is not manually assigned like in the example. I have a function that grabs some colors from an external stylesheet, puts them into an array and returns the array. That function is called getColorsFromCSS and the code is the following: getColorsFromCSS: function(cssElement) { var cssRules, cssSelector; var colors = []; // Which CSS rules are available in the browser? if (document.styleSheets[0].cssRules) { cssRules = document.styleSheets[0].cssRules; } else { cssRules = document.styleSheets[0].rules; } // Double check if the CSS rules are really available if (cssRules) { // Loops through each CSS selector for (var i = 0; i cssRules.length; i++) { cssSelector = cssRules[i].selectorText.toLowerCase(); // Get colors from which CSS elements? if (cssElement == 'links') { // Gets the color value for a specific selector switch (cssSelector.replace(/,.+/i, )) { case ul#cp-block-items a:link: colors[0] = cssRules[i].style.color; break; case ul#cp-block-items a:hover: colors[1] = cssRules[i].style.color; break; case div#content a:link: colors[2] = cssRules[i].style.color; break; case div#content a:hover: colors[3] = cssRules[i].style.color; break; } // if(colors.length == 4) return colors; } else if (cssElement.indexOf('popup') == 0) { // Gets the color value for a specific selector switch (cssSelector.replace(/,.+/i, )) { case div# + cssElement: colors[0] = cssRules[i].style.color; colors[1] = cssRules[i].style.backgroundColor; break; } // if(colors.length == 2) return colors; } } } }, Yes, the function is working, meaning the values are retrieved from the external CSS and the array is returned with all the values inside it. I conformed this by doing an alert(popupColors[0]); before trying to set the border color and the output was a string with the color value (like the code below). And my real code goes like this: var popupColors = $.admin.getColorsFromCSS('popup-notice-error'); alert(popupColors[0]); // This outputs the color value assigned to this array index $('div#popup-block').css('borderColor', popupColors[0]); // But this doesn't work :( This is only happening in IE6/7, not on Firefox 2.0.0.12, Opera 9.26 and Safari 3.1 (Win). Any thoughts on this?
[jQuery] Re: accessing elements with . in their ids without escaping
Escape like: '#123.123'.replace(/\./g, '.'); // = #123\\.123 ---Klaus On Mar 24, 7:00 pm, Harald Armin Massa [EMAIL PROTECTED] wrote: hello, I am in the process of moving to jQuery. One challenge is: many of the relevant IDs of Elements have one or more dots within them. I read within the FAQ that I can escape them when using the $(#some\ \.id) selector. Is there another possible way, like $().getelementbyid(#123.123) ? or is there an escaping-function allready in the wild? Or do I have to come up with my own escaping function? Best wishes Harald