Re: [jQuery] Re: How to avoid page refresh with jquery in typo3 ?
chris wrote: On Nov 6, 5:25 pm, Jonathan Vanherpe (T T NV)jonat...@tnt.be wrote: I guess you'll just need to add this: $('div#menu').load($(this).attr('href')+' div#menu'); But I should warn you, this is far from efficient, as you're making 2 requests for the same page this way, instead of the one request it would take to just load the page normally. I personally think it's just not worth the effort, but I've told you that before. yes i figured that out, also solved the menu highlighting which was just a CSS div order error on my part. this is how it works for the moment: script src=http://code.jquery.com/jquery-latest.js;/script script $(document).ready(function(){ $('#menu a').click(function(){ $('#maincontent').load($(this).attr('href')+' #maincontent'); $('.submenu').load($(this).attr('href')+' .submenu'); return false; }); }); /script in Safari on the mac it works, the pages load and the submenu loads, however there is a problem with the submenu. on the first click of a submenu item the page loads/refreshes completely but then when i click on another submenu item it loads correcrly directly into the div without refresh, and then alternately, once it loads into the div, once it refreshes the whole page .. in Firefox on the mac the first level menu and loading works but the submenu doesn't appear In Internet Explorer 8 the first level works 'sort of' on some clicks it loads a page corrctly and on other clicks it doesn't load at all, but it's random, i did a series of 10 clicks several times in a row after cleaning cache each time and everytime it works/doesn't on some other combination of pages ... after a dozen clicks or so it doesn't load anything at all anymore ... Do you have a link we can see this at? in terms of efficiency and not being worth the effort, could you elaborate your thoughts on this. the actual page content i am loading through those calls is only very short text paragraphs (maincontent) and a 4 item list (submenu). i have three columns: [snip] so i thought my solution would be more efficient than a traditional refresh can you explain why i got it wrong ? for this site i don't need bookmarking/history or back button browser functionality ... Well, even though you're only showing part of the page, the whole page gets downloaded by your browser (twice, since you're calling load() twice). jQuery will download the whole page, then parse it, throw away what is doesn't need, and insert the small chunk you wanted into the page. Basically this is slower then just loading the page straight away (but I guess you don't see the flicker that's associated with a page load). thx again for the help ! Jonathan -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] JQuery error load data in dialog
dear friends, I have one input field, when I write some letter and press enter then ajax request will happen. Return value from ajax I append to one tag div. Then I load data into dialog. I can do that, but the problem is It just happens one time and the problem when data successfully load, the close button of the dialog doesn't work fine. Do I have something wrong?? this is my example code : $(#dialog).dialog({ bgiframe: true, autoOpen: false, height: 900, width:800, modal: true, buttons: { 'Tutup': function() { $(this).dialog('close'); }, 'Simpan' : function() { $('form#saveform').submit(); } } }); $('.textfield').keypress(function(event){ if (event.which == 13) { var z = $(this).attr('id'); var nilai = $('#'+z).val(); $('#nick').val(nilai); $('#fpersonform').submit(); } }); $('#personform').submit(function() { $.ajax({ type: POST, url: some_url, data: 'name=' + $('#nick').val(), success: function(data) { $('#dialog').dialog('open'); $('#dialog').html(data); } }) return false; });
[jQuery] Re: (validate plugin) dependency callback not being triggered
Thanks Jules I'll give it a try now. I was looking for something that would trigger the validation but I thought it was automagically triggered onblur/keyup but perhaps thats only after the initially validate via submit * thanks for the typo spotting!.. totally missed that ta Brad On Nov 6, 11:14 am, Jules jwira...@gmail.com wrote: Hi, Validation only triggered if you call submit the page or call the $ (form).valid() function. I didn't see any submit() or $ (form).valid() call in your page. Try adding this to your page js script inside ready() $(#validateMe).click(function(){ if($(form).valid()) alert(All data are valid); else alert(Invalid data); }); html input type=button id=validateMe name=validateMe value=Validate / Hope this help. BTW: you misspelled territory in ACT :) On Nov 6, 12:06 pm, Brad Hile brad.h...@gmail.com wrote: Bump Hi I've tried every way I can think of to use dependency to enable additional elements to be required and have had no luck at all. I simply want to enable required on a number of fields when a specific radio button is selected and for it to be disabled when its not. (These fields are hidden when the radio button is deselected) I've tested the response from the functions and it appears correct but after hours of staring at this I just can't figure it out. Help.. please? original code is onhttp://promotionalpenshop.com.au/testorder.php?p=4 though I may have changed it by the time you look at this. So basically I've tried an inline function something like: organisation:{required: function(element) { return $(.payment_type:checked).val() == 'invoice'); } } - - - - - - - - - - - - - - Setting a var to true/false when the radio button is clicked and testing that: var invoice; $(.payment_type).change(function () { if($(this).val() != 'paypal'){ $(#paybyinvoicefields).slideDown('slow'); invoice = true; } else { $(#paybyinvoicefields).slideUp('slow'); invoice = false; } organisation:{required: invoice} - - - - - - - - - - - - - - Using an enternal function organisation:{required: invoiceme() } function invoiceme() { return ($(.payment_type:checked).val() == 'invoice')? true : false; }
[jQuery] SEO - jquery not loaded for second time
Hi, I hope this is the right group I am posting to. I'm trying using htaccess for SEO friendly. The htaccess sample is below IfModule mod_rewrite.c Options -MultiViews RewriteEngine on RewriteBase / RewriteRule .* - [env=REWRITE_ON:1] RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*)$ index.php?url=$1 [L] /IfModule then i can type at the address bar like http://mydomain/param1/value1 and my index.php will load The problem is when it load the first time page is ok and then when I type another link like http://mydomain/param2/value2 the jquery seems not working anymore. I need to press F5 then it will ok. I put META refresh in the HEAD and it works. BUT this is not what I want. What I want is the page reload when people type in the address bar + press enter NOT everytime the page keep refreshing for the same URL. Hope can help
[jQuery] Re: Strange behaviour of BlockUI
Mike, The problem is partially solved. Can you post a link to this page? No, I can't - since it is a project all the time being developed on localhost. Is inner-holder-error the outer most element used for blocking? For example, does your block call look like this: $.blockUI({ message: $('#inner-holder-error') }); Yes - that was the problem. I ported blockui in place of jquery ui dialog box and messed up with div's names. After corection problem of hiding/unhiding divs is solved. The default settings are meant to handle a simple, short message. But But I still can understand why blockui does not centers my message vertically (horizontally is fine) if I use default options (no css no option changing except message text)? By default centerX and centerY are set to true, right? Here you can see effect: http://trejderowski.pl/trash/blockui.jpg you can control the position of the message usingblockUI's'css' option. There is an example on the demos page that shows how to control position with tall content. Yes. Bus AFAIK all examples, including the one I used: $.blockUI ({ message: $('#inner-holder-error'), css: { top: ($(window).height() - 500) /2 + 'px', left: ($(window).width() - 500) /2 + 'px', width: '500px', height: '500px' } }); requires providing widht and height. And what is most convinient and most welcomed in default settings is that message is being centered vertically and horizontally without providing it's dimensions. At least that what should happen and happens in most situation as for one most important for me effect you can see above - message is not being centered vertically. Cheers, Tomasz
[jQuery] Re: (validate) preclude, deny, disallow or prohibit URLs from submitting
Thank you so much for the answer - and sorry for not picking up on it sooner! (I expected to get anemail notifcation!) I've had a go at implementing this new method but it's not working for me. I've added your code into my validate call but it's not doing anything there. santiagorestaurant.es/contact.php Thanks again for your help. Gabriel On Oct 21, 3:03 pm, livefree75 jpittm...@gmail.com wrote: You need to create a new plugin method: $(function() { $.validator.addMethod(no_urls, function(value, element) { var re = new RegExp(([a-z\d\\-]+\\.)+[a-z]+), i); // or whatever RegExp you want var url_found = re.test(value); return this.optional(element) || (!url_found); }, URLs are not allowed. ); }); Then, in your validate() call, do the following: // $f is the form $f.validate({ rules : { comment : { required : true, no_urls : true } } }); On Oct 21, 3:14 am,gdekadtgdek...@gmail.com wrote: [bump] Anybody out there with any clues or suggestions? On Oct 15, 11:05 am,gdekadtgdek...@gmail.com wrote: Hi all sorry - I can't figure this out and I'm a little thick. I'm using the great validation plug-in from bassistance and would like to use it to stop a form submitting contents of a *required* comment field when a URL is present in there. [Getting spam links submitted to a contact from] I've previously managed to hack the plugin to allow spaces and a leading + for phone numbers but this is beyond me as I'm not trying to extend but rather invert the function. ? I've been trying for two hours and can neither find anything out there - or hack anything that works.
[jQuery] getting height of *remaining* divs in a container
I have the structure shown at the bottom of this post. The scenario is that relative to an event on the page the scrollTo is used to set the #top to the necessary cc_ DIV. The problem is that the container in which all cc_'s are placed is 202px in height (can change). When the scrollTo is instructed and the height of the remaining cc_ DIVs left is less than this it corrupts and future scrollTo's do not function correctly (the #cc_n doesn't scrollTo the top of the DIV but further down!) I suspect the solution will be somewhere in the region of rather than just issuing the scrollTo... - get the total height of all the divs starting with cc_ after me (being the current cc_ DIV) - if the value above is higher than my parent DIV height then issue the scrollTo Sounds easy but any help with the syntax (or indeed a pointer if I'm on the wrong track) would be splendid! Cheers Dylan div id=poiScrollPaneHolder div class=jScrollPaneContainer style=width: 235px; height: 202px; div id=poiScrollPane style=overflow: visible; height: auto; width: 218px; padding-right: 5px; position: absolute; top: 0px; div class=item id=cc_0 div class=poi-title testPOI ONE/div div class=textPOI Title Text here./div /div div class=item id=cc_1 div class=poi-title testPOI TWO/div div class=textPOI Title Text here./div /div . . . div class=item id=cc_15 div class=poi-title testPOI FIFTEEN/div div class=textPOI Title Text here./div /div /div /div div class=jScrollPaneTrack style=width: 12px; height: 178px; top: 12px; div class=jScrollPaneDrag style=width: 12px; height: 16px; top: 162px; div class=jScrollPaneDragTop style=width: 12px;/ div class=jScrollPaneDragBottom style=width: 12px;/ /div /div a href=javascript:; class=jScrollArrowUp style=width: 12px;Scroll up/a a href=javascript:; class=jScrollArrowDown disabled style=width: 12px;Scroll down/a /div !-- see default.js/createPOI/poiMarkup -- /div
Re: [jQuery] getting height of *remaining* divs in a container
Isn't there a bit of JavaScript missing in this question ? Anyway, if I've got your problem right and if I were you at this point, I'd rather use the position http://docs.jquery.com/CSS/position method of the element you want to scroll down to instead of adding heights which might be a lot trickier (you'd have to take margins, paddings and such into account). Michel Belleville 2009/11/9 Dylan dylan.h...@gmail.com I have the structure shown at the bottom of this post. The scenario is that relative to an event on the page the scrollTo is used to set the #top to the necessary cc_ DIV. The problem is that the container in which all cc_'s are placed is 202px in height (can change). When the scrollTo is instructed and the height of the remaining cc_ DIVs left is less than this it corrupts and future scrollTo's do not function correctly (the #cc_n doesn't scrollTo the top of the DIV but further down!) I suspect the solution will be somewhere in the region of rather than just issuing the scrollTo... - get the total height of all the divs starting with cc_ after me (being the current cc_ DIV) - if the value above is higher than my parent DIV height then issue the scrollTo Sounds easy but any help with the syntax (or indeed a pointer if I'm on the wrong track) would be splendid! Cheers Dylan div id=poiScrollPaneHolder div class=jScrollPaneContainer style=width: 235px; height: 202px; div id=poiScrollPane style=overflow: visible; height: auto; width: 218px; padding-right: 5px; position: absolute; top: 0px; div class=item id=cc_0 div class=poi-title testPOI ONE/div div class=textPOI Title Text here./div /div div class=item id=cc_1 div class=poi-title testPOI TWO/div div class=textPOI Title Text here./div /div . . . div class=item id=cc_15 div class=poi-title testPOI FIFTEEN/div div class=textPOI Title Text here./div /div /div /div div class=jScrollPaneTrack style=width: 12px; height: 178px; top: 12px; div class=jScrollPaneDrag style=width: 12px; height: 16px; top: 162px; div class=jScrollPaneDragTop style=width: 12px;/ div class=jScrollPaneDragBottom style=width: 12px;/ /div /div a href=javascript:; class=jScrollArrowUp style=width: 12px;Scroll up/a a href=javascript:; class=jScrollArrowDown disabled style=width: 12px;Scroll down/a /div !-- see default.js/createPOI/poiMarkup -- /div
[jQuery] Re: document.body is null on, Google Web optimiser redirects.
FYI anyone with this same issue.. Not really a JQuery issue. GWO control scripts need to be loaded before jQuery. it is a race condition. jQuery is still loading whilst the redirect is in operation.. hence no body in the DOM. On 6 Nov, 16:57, paulroon paulr...@gmail.com wrote: Hey all, Head scratching here, We have GoogleWebOptimiserrunning some A/B tests on our site. Effectively Google drops a cookie that triggers a redirect to another version of the same page. We have (seemingly without change) started seeing a JS Error during the redirection that is coming from jQuery. Specifically jQuery 1.3.2. If I drop the version from 1.3.2 down to our old 1.2.6 version the issue goes away. Here is a firebug console output document.body is null document.body.appendChild( div );\n thanks in advance
[jQuery] Create PDF from js
Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo
[jQuery] Re: (validate) Customising bassistance validation plugin
Hi Jörn, On Nov 7, 3:28 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: The plugin by default picks up attributes, so if you're using attribute names that match validation plugin methods, it should work like that. Though you may need to also provide a value, ala required=true, not sure about that. This works for validation methods, but not for the required... Regards - Iwan
[jQuery] Re: Strange behaviour of BlockUI
In addition to above, some observations. 1. I changed: $.blockUI ({ message: $('#inner-holder-error'), css: { top: ($(window).height() - 500) /2 + 'px', left: ($(window).width() - 500) /2 + 'px', width: '500px', height: '500px' } }); to: $.blockUI ({ message: $('#inner-holder-error'), css: { top: ($(window).height() - $('#inner-holder- error').height()) /2 + 'px', left: ($(window).width() - $('#inner-holder- error').width()) /2 + 'px' } }); to force displaying centered message no matter of it's dimensions. But this fails as either $('#inner-holder-error').height() returns incorrect value (759 pixels in my situation, where 308 px should be) or blockui changes div width AFTER displaying it. Effect - message still not being centered vertically. 2. I used some jquery UI inner classes for forcing theming as I would like to see it (what theme: true does is not what I want to see) and was very surprised that block UI ignores round corners on FF for two of four sides. See example: http://trejderowski.pl/trash/blockui-2.jpg Really strange I must admit. 3. Did you noticed / were aware that any alert('') places AFTER blockUI call will be displayed BEFORE block UI blocks page? Cheers, T.
Re: [jQuery] Create PDF from js
I'd look into something server-side if I was you: http://code.google.com/p/wkhtmltopdf/ is a good option, if you have a way of running custom binaries on your server. Jonathan m.ugues wrote: Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Content within Floating Window using jQuery SimpleModal plugin cannot be replaced in IE8
Hi all I have already posted on stackoverflow about this issue. Here a short description: A Javascript function gets called from within a SimpleModal window. In this function some content found in this modal window is replaced - e.g. $('#DivTest').html('ChangedValue'). In IE8, if the SimpleModal window is closed and opened again, it is not possible anymore to change any content within this modal window or set elements to invisible etc.. You can see that content and attributes of DOM objects have been changed, in example by making use of alert function, but these changes are not rendered. More details can be found here: http://stackoverflow.com/questions/1697954/content-within-floating-window-using-jquery-simplemodal-plugin-cannot-be-replaced Any hints? Thanks and cheers, Roger
[jQuery] Dynamic URL call i JQuery Cascade
HI, I have been succesfully using Cascade for some time now but I have hit a wall. I have over 20,000 lines of data and consequently the server load and subsequent delay for the user is making the cascade feature very poor. I currently generate the list via php which works well for me. What I would like to do is to append ?country=COUNTRY ID (i.e 1,2,3,4,5 etc dependant on user selection) I am using: jQuery(document).ready(function() { jQuery(#region).cascade(#countryn,{ ajax: {url: 'gui/_js/lists/regions.php?country='+$ (#countryn) }, template: commonTemplate, match: commonMatch }); }); Could someone cast some light?
[jQuery] Calling function in jQuery
Hi all, I am creating a function using jQuery in application.js file. (function($) { function test() { alert('in function'); } })(jQuery); When I am trying to call this function from outside (not in this jQuery block), I am getting an error saying that function is not defined. I am including this file, also I am calling this function from a jQuery block. Still I am getting this error. How to call that function? Also, I am facing another issue. I have a form with select option. It will be populated dynamically after every ajax request. In form, I have a select tag with no options. select id='users' /select After getting a content from ajax, I am preparing all the available options, and placing that content in select tag. var opts = option value='1'Murali/optionoption value='2'Krishna/option; $(#users).html(opts); But it is not showing any options in the select tag. Pls help me, -- Thanks Regards, Murali Krishna.B
Re: [jQuery] Calling function in jQuery
The function by itself will not be available within other blocks, since the function is in local scope. You should attach the function to the jQuery object instead for later use using the following syntax : (function($) { $.function_name = function test() { alert('in function'); } })(jQuery); Then later in other jQuery blocks (although you will have to ensure that your previously defined block has been already included) you can call your function simply by using $.function_name(); Thanks Regards, Dhruva Sagar. On Mon, Nov 9, 2009 at 4:27 PM, Murali Krishna B muralikrishna.vi...@gmail.com wrote: Hi all, I am creating a function using jQuery in application.js file. (function($) { function test() { alert('in function'); } })(jQuery); When I am trying to call this function from outside (not in this jQuery block), I am getting an error saying that function is not defined. I am including this file, also I am calling this function from a jQuery block. Still I am getting this error. How to call that function? Also, I am facing another issue. I have a form with select option. It will be populated dynamically after every ajax request. In form, I have a select tag with no options. select id='users' /select After getting a content from ajax, I am preparing all the available options, and placing that content in select tag. var opts = option value='1'Murali/optionoption value='2'Krishna/option; $(#users).html(opts); But it is not showing any options in the select tag. Pls help me, -- Thanks Regards, Murali Krishna.B
[jQuery] (validate) remote option problem.
Hi, I have this horrible problem that i've spent like 2 days looking for a easy solution but to no avail. I've been using the jQuery validation plugin to do the validation for me and it has working great so far. I've added the remote option and it communicates perfectly with the server and sends the responde back to the user. I don't know it is a bug or that is the way the author intended for it to work but if there is a problem with the remote validation. I've made an function that should be triggered and send a 'callout' to the field. I add this function for the remote in the message section in 'rules'. This should ONLY happen when the field is validated as false. For some reason the second i press on submit it doesn't matter the outcome of the remote validation. it simply executes my function at all times. My code: $(document).ready(function() { $(#form).validate({ errorClass: errorClass, ignoreTitle: true, errorPlacement: function(error, element) { }, rules: { Name: { required: true, minlength: 2, remote: { url: '%= Url.Action(VerifyName)%', type: 'POST', dataType: 'json', data: { Name: function() { return $('#Name').val(); }, Id: function() { return selectedID; } } } }, Category: { required: true, minlength: 1, digits: true }, Country: { required: true } }, messages: { Name: { required: , minlength: , remote: function(element) { //alert(hello) showCallOut(Name, 'This name already exists'); } }, Category: }, focusInvalid: false, onkeyup: false, onfocusout: false, highlight: function(element, errorClass) { $(element).addClass(errorClass); }, unhighlight: function(element, errorClass) { $(element).removeClass(errorClass); } }); }); What can i do to solve this issue? Is this a bug in validation plugin? How do I contact the owner of the validation plugin? I've read a thread with the similar problem but the solution doesn't work in my situation: http://groups.google.com/group/jquery-en/browse_thread/thread/45ce7e9f59979b67/089e0b018e79da5a?#089e0b018e79da5a
[jQuery] Re: (validate) Customising bassistance validation plugin
Ah, I got it working... The value of the required attribute should be a dependency-expression (http://docs.jquery.com/Plugins/Validation/ Methods/required#dependency-expression ) So, required=true does not work. I'm still trying to figure out what else can be in there / what exactly a dependency-expression is, but it seems that the following works (although I'd like to understand still...): required=:true required={:true} required={anynamehere:true} required={:anystringhere} -i On Nov 9, 2:14 pm, Iwan Vosloo i...@reahl.org wrote: Hi Jörn, On Nov 7, 3:28 pm, Jörn Zaefferer joern.zaeffe...@googlemail.com wrote: The plugin by default picks up attributes, so if you're using attribute names that match validation plugin methods, it should work like that. Though you may need to also provide a value, ala required=true, not sure about that. This works for validation methods, but not for the required... Regards - Iwan
[jQuery] help with milkbox conflict
Hi, I am new to this and attempting to use milkbox. It looks like jquery-1.3.2.min.js is preventing milkbox from working. I wonder if there is an obvious conflict (already documented), or if this requires more exploration. I am pasting code below. Thank you. Jessica style type=text/css @import url(css/milkbox/milkbox.css);/style script type=text/javascript src=js/mootools-1.2.3-core-yc.js/ script script type=text/javascript src=js/mootools-1.2.3.1-more.js/ script script type=text/javascript src=js/milkbox.js/script script type=text/javascript src=js/mootools-1.2.3.1-assets.js/ script link type=text/css href=2010css/jquery-ui.css rel=stylesheet / link type=text/css href=2010css/general.css rel=stylesheet / script type=text/javascript src=2010js/jquery-1.3.2.min.js/ script script type=text/javascript src=2010js/jquery- ui-1.7.2.custom.min.js/script script type=text/javascript $(function(){ // Accordion $(#accordion).accordion({ header: h3 }); // Accordion $(#accordion2).accordion({ header: h3 }); // Tabs $('#tabs').tabs(); // Tabs $('#tabs2').tabs(); // Dialog $('#dialog').dialog({ autoOpen: false, width: 600, buttons: { Ok: function() { $(this).dialog(close); }, Cancel: function() { $(this).dialog(close); } } }); // Dialog Link $('#dialog_link').click(function(){ $('#dialog').dialog('open'); return false; }); // Datepicker $('#datepicker').datepicker({ inline: true }); // Slider $('#slider').slider({ range: true, values: [17, 67] }); // Progressbar $(#progressbar).progressbar({ value: 20 }); //hover states on the static widgets $('#dialog_link, ul#icons li').hover( function() { $(this).addClass('ui-state-hover'); }, function() { $(this).removeClass('ui-state-hover'); } ); }); /script
Re: [jQuery] help with milkbox conflict
See http://docs.jquery.com/Using_jQuery_with_Other_Libraries http://docs.jquery.com/Using_jQuery_with_Other_Librariesand http://docs.jquery.com/Core/jQuery.noConflict http://docs.jquery.com/Core/jQuery.noConflict- Richard On Mon, Nov 9, 2009 at 8:02 AM, jessicaw1974 jessicaw1...@gmail.com wrote: Hi, I am new to this and attempting to use milkbox. It looks like jquery-1.3.2.min.js is preventing milkbox from working. I wonder if there is an obvious conflict (already documented), or if this requires more exploration. I am pasting code below. Thank you. Jessica style type=text/css @import url(css/milkbox/milkbox.css);/style script type=text/javascript src=js/mootools-1.2.3-core-yc.js/ script script type=text/javascript src=js/mootools-1.2.3.1-more.js/ script script type=text/javascript src=js/milkbox.js/script script type=text/javascript src=js/mootools-1.2.3.1-assets.js/ script link type=text/css href=2010css/jquery-ui.css rel=stylesheet / link type=text/css href=2010css/general.css rel=stylesheet / script type=text/javascript src=2010js/jquery-1.3.2.min.js/ script script type=text/javascript src=2010js/jquery- ui-1.7.2.custom.min.js/script script type=text/javascript $(function(){ // Accordion $(#accordion).accordion({ header: h3 }); // Accordion $(#accordion2).accordion({ header: h3 }); // Tabs $('#tabs').tabs(); // Tabs $('#tabs2').tabs(); // Dialog $('#dialog').dialog({ autoOpen: false, width: 600, buttons: { Ok: function() { $(this).dialog(close); }, Cancel: function() { $(this).dialog(close); } } }); // Dialog Link $('#dialog_link').click(function(){ $('#dialog').dialog('open'); return false; }); // Datepicker $('#datepicker').datepicker({ inline: true }); // Slider $('#slider').slider({ range: true, values: [17, 67] }); // Progressbar $(#progressbar).progressbar({ value: 20 }); //hover states on the static widgets $('#dialog_link, ul#icons li').hover( function() { $(this).addClass('ui-state-hover'); }, function() { $(this).removeClass('ui-state-hover'); } ); }); /script
[jQuery] show/hide ui.tab?
I have a series of tabs using UI. I need to hide some tabs depending on the selection in the first tab. Doing $(#tab3).hide(); doesn't work. This is what I have thus far: $(#div.jobtype input[name='jobtype']).click( function () { $(#tabLocations).hide(); $(#tabSegments).hide(); $(#tabWellholes).hide(); switch($(this).val()) { case other: $(#tabLocations).show(); break; case pipeline: $(#tabSegments).show(); break; case wellsite: $(#tabWellholes).show(); break; } }); I did try to add the class ui-tabs-hide to the tab, but that didn't work either. I also did a Google search I don't want to add/remove tabs - that is not quite what I'm after. I just need to hide/show the tabs. Any thoughts/suggestions? Shawn
[jQuery] jQuery helper function access
Hi, there are a couple functions declared in jQuery such as genFx and num, that would be useful in other aspects of jQuery development, and other js activities. They are not attatched to the jQery ovbject. Is there any way currently to access them (me thinks not?), and could they be instead declared as members of a new object such as jQuery.util? Would it be a performace hit, or is there another reason not to expose them? Thanks!
[jQuery] Re: show/hide ui.tab?
Show/Hide works perfectly fine in this quick example http://jsbin.com/oyagi/edit recall that the tabs are actually li items that reference the tabs, which are div's to hide the tab itself, you need to hide the li On Nov 9, 10:23 am, Shawn sgro...@open2space.com wrote: I have a series of tabs using UI. I need to hide some tabs depending on the selection in the first tab. Doing $(#tab3).hide(); doesn't work. This is what I have thus far: $(#div.jobtype input[name='jobtype']).click( function () { $(#tabLocations).hide(); $(#tabSegments).hide(); $(#tabWellholes).hide(); switch($(this).val()) { case other: $(#tabLocations).show(); break; case pipeline: $(#tabSegments).show(); break; case wellsite: $(#tabWellholes).show(); break; } }); I did try to add the class ui-tabs-hide to the tab, but that didn't work either. I also did a Google search I don't want to add/remove tabs - that is not quite what I'm after. I just need to hide/show the tabs. Any thoughts/suggestions? Shawn
Re: [jQuery] Re: show/hide ui.tab?
Thanks. Your message got me looking in the right direction. Turns out my selector was wrong. Needed #jobtype, not div.jobtype. Once I changed that everything worked as expected. Shawn MorningZ wrote: Show/Hide works perfectly fine in this quick example http://jsbin.com/oyagi/edit recall that the tabs are actually li items that reference the tabs, which are div's to hide the tab itself, you need to hide the li On Nov 9, 10:23 am, Shawn sgro...@open2space.com wrote: I have a series of tabs using UI. I need to hide some tabs depending on the selection in the first tab. Doing $(#tab3).hide(); doesn't work. This is what I have thus far: $(#div.jobtype input[name='jobtype']).click( function () { $(#tabLocations).hide(); $(#tabSegments).hide(); $(#tabWellholes).hide(); switch($(this).val()) { case other: $(#tabLocations).show(); break; case pipeline: $(#tabSegments).show(); break; case wellsite: $(#tabWellholes).show(); break; } }); I did try to add the class ui-tabs-hide to the tab, but that didn't work either. I also did a Google search I don't want to add/remove tabs - that is not quite what I'm after. I just need to hide/show the tabs. Any thoughts/suggestions? Shawn
[jQuery] Need Sample Code for Menu-Driven Web Application
I am ramping up on jQuery and CSS, AJAX, etc. I am looking for sample code that would demonstrate best practices for a menu driven web application. I am really interested in the use of AJAX since our application displays a lot of dynamic content (status monitoring, events, etc). Does anyone have any good recommendations? -- View this message in context: http://old.nabble.com/Need-Sample-Code-for-Menu-Driven-Web-Application-tp26268844s27240p26268844.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] resize.simplemodal
Hi, I have been searching for a way to resize simplemodal dialog after showing it. In plugin source i can see that a function 'resize.simplemodal' is bound to window on initialization. Ive tried to call this function directly with no luck. Is there a way to have simplemodal recalculate its size after loading/showing? (I need this since extra content is beeing loaded via AJAX after showing the dialog initialy) Regards Milos
[jQuery] Thanks for a wonderful library
I just want to say thanks to the jQuery team for an excellent tool! And I want to add a shout-out to Remy Sharp for a technique that made it possible. My latest project involves little front-end work, and I haven't been using jQuery much, but I recently had a little itch to scratch, and jQuery made it quite easy to easy to do. In fact, had I not had jQ at my fingertips, I probably would never have even attempted it. Thanks for a wonderful library! Below are the ugly details for anyone intersted: JBoss is a Java application server, and it provides a management console that is functional but poorly organized. When viewing a particular MBean page, the attributes and operations available are listed, but not in any logical order. Using the technique I shamelessly lifted from Remy Sharp [1], a created a bookmarklet that I can run to clean up these MBean pages. My first approach simply sorted the table that contained these attributes and sorted the collection of forms that contained the operations, so that I could find what I wanted more easily. That worked, but it still left something lacking: a table of contents. So I added my own table of contents that automatically collapses out of the way to a fixed-position, mostly transparent header that when clicked expands the fully opaque TOC back to a list of links. All this in fewer than 50 lines of (admittedly dense) Javascript, and about 90 minutes of coding, interspersed with other more urgent work! If you use the JBoss JMX console, and want to try it, you can grab the bookmarklet at http://scott.sauyet.com/ESPN/. If for some strange reason, you want to see the actual code, it's at http://scott.sauyet.com/ESPN/OrganizeMBean/organize.js. It doesn't work properly in IE [2], but I can't be bothered to try to fix it, as it's really only for my own use. It works in all the other browsers I tested. So again, thank you to John and the jQuery team for such an excellent tool! -- Scott Sauyet [1] See http://leftlogic.com/lounge/articles/speech-bubbles/ for a great example of loading jQuery, a custom JS file, and calling it, all from a bookmarklet. [2] Wow, I've never heard that phrase before! :-) Actually this looks like an issue with position:fixed in IE.
[jQuery] Re: Iterating over a list
Is that close to what I was doing on the second example, where I was calling $().text in the callback portion of fadeIn()? On Nov 9, 12:38 am, Michel Belleville michel.bellevi...@gmail.com wrote: To use callbacks that are triggered actually when the animation finishes instead of calling the animations all at once and seeing only the very last because they all start approximately at the same time. Michel Belleville 2009/11/9 gthorne gtho...@gmail.com I'm not sure I follow what the principle is? On Nov 8, 1:16 pm, Michel Belleville michel.bellevi...@gmail.com wrote: Typo indeed ^^° Though the principle is sound. Michel Belleville 2009/11/8 Sam Doyle sammeh@gmail.com $(this).fadeOu(duration, function() { Typo Sent from my iPhone On 8 Nov 2009, at 07:27, Michel Belleville michel.bellevi...@gmail.com wrote: $(this).fadeOu(duration, function() {
[jQuery] Re: Create PDF from js
I prefer to make the job client-side if is possible. My idea is to intercept the window.print command (where the layout is correct through the css print) and not to send it to the printer but to send it in some way to the constructor of this library http://code.google.com/p/jspdf/ Am I completely wrong? Or may it works? Kind regards Massimo On 9 Nov, 13:19, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: I'd look into something server-side if I was you:http://code.google.com/p/wkhtmltopdf/is a good option, if you have a way of running custom binaries on your server. Jonathan m.ugues wrote: Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Confirm Delete
I am attempting to add a class to a div before deleting it. I just cant get the class to remove if the user selects no. Anyone have tips or a link with suggestions? I found the jquery.confirm.js script but unable to add a class to the element being deleted before confirm Thanks Dave
Re: [jQuery] Confirm Delete
On Mon, Nov 9, 2009 at 8:58 AM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I am attempting to add a class to a div before deleting it. I just cant get the class to remove if the user selects no. Anyone have tips or a link with suggestions? I found the jquery.confirm.js script but unable to add a class to the element being deleted before confirm Hard to give guidance without seeing what code you are using now. Also, in your first paragraph you say I just cant get the class to remove. In your second paragraph, you say you are unable to add a class. So not sure which it is. Either way, $('#myDiv').addClass('className'); or $('#myDiv').removeClass('className') should be all you need. If those aren't working out, seeing some code would go a long way towards helping to troubleshoot. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Paging
Hi All, Im new to Jquery, I want to do table paging, Can some body help me to do this Warm Regards, Mari Raj K, Bangalore +91 9740765135
RE: [jQuery] Confirm Delete
My bad. Here is what I have so far. $(a.delete).live('click', function (){ var url_id = $(this).attr(href); var div_id = url_id.split('/'); var set_id = 'set_'+div_id[div_id.length-1]; $('#'+set_id).addClass('pre_delete'); $.ajax({ type: POST, url: url_id, success: function(){ $('#' + set_id).fadeOut('slow', function () { $(this).remove(); }); } }); return false; }); I need to add in the confirm message. Above just adds the class when delete is clicked then deletes it. I would like the click delete add the class to the div then the confirm message appears. If they select yes then delete goes thru, if selected no then the added class gets removed. Thanks again Dave From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: November-09-09 1:32 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Confirm Delete On Mon, Nov 9, 2009 at 8:58 AM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I am attempting to add a class to a div before deleting it. I just cant get the class to remove if the user selects no. Anyone have tips or a link with suggestions? I found the jquery.confirm.js script but unable to add a class to the element being deleted before confirm Hard to give guidance without seeing what code you are using now. Also, in your first paragraph you say I just cant get the class to remove. In your second paragraph, you say you are unable to add a class. So not sure which it is. Either way, $('#myDiv').addClass('className'); or $('#myDiv').removeClass('className') should be all you need. If those aren't working out, seeing some code would go a long way towards helping to troubleshoot. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
RE: [jQuery] Re: Create PDF from js
The jsPDF project, while interesting, has a long way to go. Their demo page at http://jspdf.googlecode.com/svn/trunk/examples/basic.htm Worked fine in Safari for iPhone and Safari for Windows, but broke in Chrome and Firefox 3. And no IE support at this time. Seems a bit tricky to use a product that will only support a small percentage of internet browsers. Is there any downside for you in using server-side technology? There are many many solutions available. JK -Original Message- From: m.ugues [mailto:m.ug...@gmail.com] Sent: Monday, November 09, 2009 8:48 AM To: jQuery (English) Subject: [jQuery] Re: Create PDF from js I prefer to make the job client-side if is possible. My idea is to intercept the window.print command (where the layout is correct through the css print) and not to send it to the printer but to send it in some way to the constructor of this library http://code.google.com/p/jspdf/ Am I completely wrong? Or may it works? Kind regards Massimo On 9 Nov, 13:19, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: I'd look into something server-side if I was you:http://code.google.com/p/wkhtmltopdf/is a good option, if you have a way of running custom binaries on your server. Jonathan m.ugues wrote: Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Re: Create PDF from js
The problem using server side option is that I have a web site with a lot of pages. For every page I need to generate a PDF; so I need to create a Java class for every html page where I reproduce the html layout (since the PDF must be the same as the html shown on the screen). Another problem is that I got a lot of form: printing a form with some text with a client side option is easy: in the server side option I need to send keep in mind all the data the user has insert. I know is a strange user requirement to save every page as PDF... I wonder if is techincally possible. Thanks a lot. Massimo On 9 Nov, 18:15, Jeffrey Kretz jeffkr...@hotmail.com wrote: The jsPDF project, while interesting, has a long way to go. Their demo page at http://jspdf.googlecode.com/svn/trunk/examples/basic.htm Worked fine in Safari for iPhone and Safari for Windows, but broke in Chrome and Firefox 3. And no IE support at this time. Seems a bit tricky to use a product that will only support a small percentage of internet browsers. Is there any downside for you in using server-side technology? There are many many solutions available. JK -Original Message- From: m.ugues [mailto:m.ug...@gmail.com] Sent: Monday, November 09, 2009 8:48 AM To: jQuery (English) Subject: [jQuery] Re: Create PDF from js I prefer to make the job client-side if is possible. My idea is to intercept the window.print command (where the layout is correct through the css print) and not to send it to the printer but to send it in some way to the constructor of this libraryhttp://code.google.com/p/jspdf/ Am I completely wrong? Or may it works? Kind regards Massimo On 9 Nov, 13:19, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: I'd look into something server-side if I was you:http://code.google.com/p/wkhtmltopdf/isa good option, if you have a way of running custom binaries on your server. Jonathan m.ugues wrote: Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
Re: [jQuery] Re: Iterating over a list
Your second example was closer, considering you triggered the text change in a callback, but you still triggered the animations all at once which I think wasn't the effect you desired. So how does the example I've given you work ? Let's comment : var recursive_anim = function(list, step, target, duration) { // this is a recursive function that uses : // - list which is a list of texts to set in the target between each animation // - step the position in the list of the text to set in the target before this cycle of animation starts (0 = first text, 1 = second text, ...) // - target the element to animate // - duration the duration of the fadeIn() and the fadeOut() if (list[step]) { // when we're through the list, we stop target.text(text).fadeIn(duration, function() { // we change the target's text and we start the fadeIn() $(this).fadeOut(duration, function() { // the callback is triggered once the fadeIn() finishes, and we're using our target (the element that juste faded in) to start the fadeOut() recursive_anim(list, step + 1, $(this), duration) // the fadeOut callback is triggered once the fadeOut() also finishes, and we're trying the next step of animation (taking the next text and doing everything over with this text) }); }); } }; I corrected a small but significant typo on the line target.text(text).fadeIn(...), obviously I had forgotten the .text() method in my earlier example. Hope it helps. Michel Belleville 2009/11/9 gthorne gtho...@gmail.com Is that close to what I was doing on the second example, where I was calling $().text in the callback portion of fadeIn()? On Nov 9, 12:38 am, Michel Belleville michel.bellevi...@gmail.com wrote: To use callbacks that are triggered actually when the animation finishes instead of calling the animations all at once and seeing only the very last because they all start approximately at the same time. Michel Belleville 2009/11/9 gthorne gtho...@gmail.com I'm not sure I follow what the principle is? On Nov 8, 1:16 pm, Michel Belleville michel.bellevi...@gmail.com wrote: Typo indeed ^^° Though the principle is sound. Michel Belleville 2009/11/8 Sam Doyle sammeh@gmail.com $(this).fadeOu(duration, function() { Typo Sent from my iPhone On 8 Nov 2009, at 07:27, Michel Belleville michel.bellevi...@gmail.com wrote: $(this).fadeOu(duration, function() {
Re: [jQuery] Re: Create PDF from js
Why do you have to create the page. People can just click print, and then save as pdf? On Nov 9, 2009, at 9:30 AM, m.ugues wrote: The problem using server side option is that I have a web site with a lot of pages. For every page I need to generate a PDF; so I need to create a Java class for every html page where I reproduce the html layout (since the PDF must be the same as the html shown on the screen). Another problem is that I got a lot of form: printing a form with some text with a client side option is easy: in the server side option I need to send keep in mind all the data the user has insert. I know is a strange user requirement to save every page as PDF... I wonder if is techincally possible. Thanks a lot. Massimo On 9 Nov, 18:15, Jeffrey Kretz jeffkr...@hotmail.com wrote: The jsPDF project, while interesting, has a long way to go. Their demo page at http://jspdf.googlecode.com/svn/trunk/examples/basic.htm Worked fine in Safari for iPhone and Safari for Windows, but broke in Chrome and Firefox 3. And no IE support at this time. Seems a bit tricky to use a product that will only support a small percentage of internet browsers. Is there any downside for you in using server-side technology? There are many many solutions available. JK -Original Message- From: m.ugues [mailto:m.ug...@gmail.com] Sent: Monday, November 09, 2009 8:48 AM To: jQuery (English) Subject: [jQuery] Re: Create PDF from js I prefer to make the job client-side if is possible. My idea is to intercept the window.print command (where the layout is correct through the css print) and not to send it to the printer but to send it in some way to the constructor of this libraryhttp://code.google.com/p/jspdf/ Am I completely wrong? Or may it works? Kind regards Massimo On 9 Nov, 13:19, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: I'd look into something server-side if I was you:http://code.google.com/p/wkhtmltopdf/isa good option, if you have a way of running custom binaries on your server. Jonathan m.ugues wrote: Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Re: Superfish CSS questio
Thanks. That takes care of the problem. All the best, luciano On Nov 8, 5:39 am, gfranklin gfrank...@gmail.com wrote: Luciano, http://apc.mcswebhost.com/about-us/history Your About button is assigned the class .active. It looks to me like .active has assigned #ccc background color. Just change .active to be something else. History button also has .active assigned to it, and .first-child as well, so look for those definition in the CSS. However, since you're on the History page, the id value #current takes precendence -- the blue background (except for when you mouse over it, which involves :hover). #current takes precedence because it is defined later in the css file. [If #current wasn't defined later than .active in the CSS, The history button would look like the About button.] -Greg p.s. I've pasted your CSS definitions below. .sf-menu .active { background: #ccc; } .sf-menu #current { background: #202f6a; } On Nov 7, 4:41 pm, luciano991 mountain...@gmail.com wrote: Hello, Thanks for your response to my inquiry. I did have a bit of sloppy code there, and I believe I have fixed that now. I just have one problem remaining. When I click on the About Us link it goes to an article called History. That all looks great. But if I choose History from the drop down menu, it still goes to the History article which is correct in the way I have arranged things. However, when you go to the History article from the Drop Down menu, the link for About Us is grey instead of the blue color I chose for the current link. Can that be corrected? Thanks, luciano On Nov 7, 5:00 am, gfranklin gfrank...@gmail.com wrote: You need to change this chunk of your CSS code: === .sf-menu li:hover, .sf-menu li.sfHover, .sf-menu a:focus, .sf-menu a:hover, .sf-menu a:active { background: ##ad0303; outline: 0; color: #fc3131; === The background has two pound signs (#), it should be only 1. And background color should be blue, not red. And the color should be white, not blue. You may need to break out all those definitions in the list into separate definitions if differing behavior is desired. On Nov 6, 6:07 pm, luciano991 mountain...@gmail.com wrote: Hello, This is my first post. I want to compliment the author on this great extension. I had trouble with it at first because I used to be a Windows guy and now I'm a Mac guy and I'm still getting used to things that are so simple and obvious I can't see the forest for the trees. I get it now and wow I implemented the module here:http://apc.mcswebhost.com If you hover on the About Us link and click History and go to that page everything is cool except now the About US link has a grey background and the drop down link for History has the blue current background I set for the top level. I can fix one but not all these problems by editing the style .sf-menu a.sf-with-ul but I would like to find the ancestors to edit to fix the problem. I want all link backgrounds for all levels to be #ad0303 with #fff for the font color, the current link should be the blue background with white print, the hover font colors should all be the same. Thanks, luciano
RE: [jQuery] Re: Create PDF from js
Can you do something like this: 1. General Java class that accepts a URL and converts it into a PDF. 2. Link on all pages that will fire the Java program passing its own url as a parameter. 3. Java program reads the contents of the url as HTML, parses it as PDF. 4. Outputs PDF stream back to browser. JK -Original Message- From: m.ugues [mailto:m.ug...@gmail.com] Sent: Monday, November 09, 2009 9:30 AM To: jQuery (English) Subject: [jQuery] Re: Create PDF from js The problem using server side option is that I have a web site with a lot of pages. For every page I need to generate a PDF; so I need to create a Java class for every html page where I reproduce the html layout (since the PDF must be the same as the html shown on the screen). Another problem is that I got a lot of form: printing a form with some text with a client side option is easy: in the server side option I need to send keep in mind all the data the user has insert. I know is a strange user requirement to save every page as PDF... I wonder if is techincally possible. Thanks a lot. Massimo On 9 Nov, 18:15, Jeffrey Kretz jeffkr...@hotmail.com wrote: The jsPDF project, while interesting, has a long way to go. Their demo page at http://jspdf.googlecode.com/svn/trunk/examples/basic.htm Worked fine in Safari for iPhone and Safari for Windows, but broke in Chrome and Firefox 3. And no IE support at this time. Seems a bit tricky to use a product that will only support a small percentage of internet browsers. Is there any downside for you in using server-side technology? There are many many solutions available. JK -Original Message- From: m.ugues [mailto:m.ug...@gmail.com] Sent: Monday, November 09, 2009 8:48 AM To: jQuery (English) Subject: [jQuery] Re: Create PDF from js I prefer to make the job client-side if is possible. My idea is to intercept the window.print command (where the layout is correct through the css print) and not to send it to the printer but to send it in some way to the constructor of this libraryhttp://code.google.com/p/jspdf/ Am I completely wrong? Or may it works? Kind regards Massimo On 9 Nov, 13:19, Jonathan Vanherpe (T T NV) jonat...@tnt.be wrote: I'd look into something server-side if I was you:http://code.google.com/p/wkhtmltopdf/isa good option, if you have a way of running custom binaries on your server. Jonathan m.ugues wrote: Hallo all. I found this library (http://code.google.com/p/jspdf/) as someone suggested to create custom PDF files from javascript. What I need now is a more difficult task. I need to create a PDF file using the css media=print. So I would like to generate a PDF file equal to what is sent to the printer. Any idea? Kind regards Massimo -- Jonathan Vanherpe - Tallieu Tallieu NV - jonat...@tnt.be
[jQuery] Re: Paging
Hi Raju, you can start by reading this: http://www.packtpub.com/article/jquery-table-manipulation-part1 Have fun! -- Bohdan On Nov 9, 6:06 pm, Raju raju3...@gmail.com wrote: Hi All, Im new to Jquery, I want to do table paging, Can some body help me to do this Warm Regards, Mari Raj K, Bangalore +91 9740765135
[jQuery] Re: Confirm Delete
$(a.delete).live('click', function (){ var url_id = $(this).attr(href); var div_id = url_id.split('/'); var set_id = 'set_'+div_id[div_id.length-1]; $('#'+set_id).addClass('pre_delete'); if (confirm('Delete?')) { $.ajax({ type: POST, url: url_id, success: function(){ $('#' + set_id).fadeOut('slow', function () { $(this).remove(); }); } }); } else { $('#'+set_id).removeClass('pre_delete'); } return false; }); On Nov 9, 12:15 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: My bad. Here is what I have so far. $(a.delete).live('click', function (){ var url_id = $(this).attr(href); var div_id = url_id.split('/'); var set_id = 'set_'+div_id[div_id.length-1]; $('#'+set_id).addClass('pre_delete'); $.ajax({ type: POST, url: url_id, success: function(){ $('#' + set_id).fadeOut('slow', function () { $(this).remove(); }); } }); return false; }); I need to add in the confirm message. Above just adds the class when delete is clicked then deletes it. I would like the click delete add the class to the div then the confirm message appears. If they select yes then delete goes thru, if selected no then the added class gets removed. Thanks again Dave From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: November-09-09 1:32 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Confirm Delete On Mon, Nov 9, 2009 at 8:58 AM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I am attempting to add a class to a div before deleting it. I just cant get the class to remove if the user selects no. Anyone have tips or a link with suggestions? I found the jquery.confirm.js script but unable to add a class to the element being deleted before confirm Hard to give guidance without seeing what code you are using now. Also, in your first paragraph you say I just cant get the class to remove. In your second paragraph, you say you are unable to add a class. So not sure which it is. Either way, $('#myDiv').addClass('className'); or $('#myDiv').removeClass('className') should be all you need. If those aren't working out, seeing some code would go a long way towards helping to troubleshoot. -- Charlie Grieferhttp://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
RE: [jQuery] Re: Confirm Delete
Right on. Thanks you. Dave -Original Message- From: MorningZ [mailto:morni...@gmail.com] Sent: November-09-09 2:25 PM To: jQuery (English) Subject: [jQuery] Re: Confirm Delete $(a.delete).live('click', function (){ var url_id = $(this).attr(href); var div_id = url_id.split('/'); var set_id = 'set_'+div_id[div_id.length-1]; $('#'+set_id).addClass('pre_delete'); if (confirm('Delete?')) { $.ajax({ type: POST, url: url_id, success: function(){ $('#' + set_id).fadeOut('slow', function () { $(this).remove(); }); } }); } else { $('#'+set_id).removeClass('pre_delete'); } return false; }); On Nov 9, 12:15 pm, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: My bad. Here is what I have so far. $(a.delete).live('click', function (){ var url_id = $(this).attr(href); var div_id = url_id.split('/'); var set_id = 'set_'+div_id[div_id.length-1]; $('#'+set_id).addClass('pre_delete'); $.ajax({ type: POST, url: url_id, success: function(){ $('#' + set_id).fadeOut('slow', function () { $(this).remove(); }); } }); return false; }); I need to add in the confirm message. Above just adds the class when delete is clicked then deletes it. I would like the click delete add the class to the div then the confirm message appears. If they select yes then delete goes thru, if selected no then the added class gets removed. Thanks again Dave From: Charlie Griefer [mailto:charlie.grie...@gmail.com] Sent: November-09-09 1:32 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] Confirm Delete On Mon, Nov 9, 2009 at 8:58 AM, Dave Maharaj :: WidePixels.com d...@widepixels.com wrote: I am attempting to add a class to a div before deleting it. I just cant get the class to remove if the user selects no. Anyone have tips or a link with suggestions? I found the jquery.confirm.js script but unable to add a class to the element being deleted before confirm Hard to give guidance without seeing what code you are using now. Also, in your first paragraph you say I just cant get the class to remove. In your second paragraph, you say you are unable to add a class. So not sure which it is. Either way, $('#myDiv').addClass('className'); or $('#myDiv').removeClass('className') should be all you need. If those aren't working out, seeing some code would go a long way towards helping to troubleshoot. -- Charlie Grieferhttp://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
Re: [jQuery] jQuery only works in offline files?!
Matt Quackenbush-2 wrote: I'm going to say that there is about a 99.99% chance that the paths to your CSS and jQuery files are incorrect. That's the odd thing about this. I immediatly thought that as well, since the symptoms are a perfect fit. But I checked and double checked. That is what I meant about uploading the entire directory, I zipped the index.html along with the necessary folder exactly the way that it is working and expanded it just like it is local. So there is no chance of that being the cause even though it has all the perfect symptoms. Thanks for the help though. -- View this message in context: http://old.nabble.com/jQuery-only-works-in-offline-files-%21-tp26261050s27240p26271237.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Ajax and removeClass
Nobody knows how to solve this issue? maybe this is the wrong mailing list? On Sun, Nov 8, 2009 at 8:28 PM, cavanshir cavanshi...@gmail.com wrote: Hello, I have page with buttons and links. I wrote a jQuery code that adds new css classes to images under clicked links. Also I have an Ajax request, which replaces buttons with identical ones, but with different content. After ajax executes, the jQuery code does not add new classes to images under links, although links and images have the same attributes. Any ideas how to fix this issue. Thanks. Cavanshir.
[jQuery] Validation Remote Question
Can you set required as remote? For example I have a year field where the server validates the rules, 4 numeric characters, required. But rather then having to put the rules for every field in the js required: true, number: true, maxlength 4, minlength:4 that are duplicates the the server validation I was hoping there was away to simply use remote for the fields. I tried using just remote but user enter abc into the year field its valid when I submit the form, then the server says no its not valid after the form is submitted. At this point the user has been directed with a successful save message even though nothing saved. So basically is there a way to set it up so every field I need checked is set to required but it checks the server for the actual validation rules? Thanks, Dave
Re: [jQuery] jQuery only works in offline files?!
If I were you I would still check the files are accessible through the url you provided in your html hooks (Firebug should help you check that), and if not I would check the permissions are set right and the files at their proper place. Also don't forget if you're using url rewriting, local paths # distant paths. Michel Belleville 2009/11/9 wesley.bunton wesley.bun...@gmail.com Matt Quackenbush-2 wrote: I'm going to say that there is about a 99.99% chance that the paths to your CSS and jQuery files are incorrect. That's the odd thing about this. I immediatly thought that as well, since the symptoms are a perfect fit. But I checked and double checked. That is what I meant about uploading the entire directory, I zipped the index.html along with the necessary folder exactly the way that it is working and expanded it just like it is local. So there is no chance of that being the cause even though it has all the perfect symptoms. Thanks for the help though. -- View this message in context: http://old.nabble.com/jQuery-only-works-in-offline-files-%21-tp26261050s27240p26271237.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Ajax and removeClass
I'm guessing you're giving behaviour to your links like this : $('#any .old_path a').click(...); So, you're giving it to any link that are present in the dom at the place you want when you're executing the former code. Then you're adding elements to the dom with an ajax call. These elements haven't had then behaviour passed to them, so they just act like normal links. You might want to use bubbling, or the easier .live() methodhttp://docs.jquery.com/Events/live(I would use live if I were you that is). Hope it solves the problem (pretty sure it will). Michel Belleville 2009/11/9 cavanshir aliyev cavanshi...@gmail.com Nobody knows how to solve this issue? maybe this is the wrong mailing list? On Sun, Nov 8, 2009 at 8:28 PM, cavanshir cavanshi...@gmail.com wrote: Hello, I have page with buttons and links. I wrote a jQuery code that adds new css classes to images under clicked links. Also I have an Ajax request, which replaces buttons with identical ones, but with different content. After ajax executes, the jQuery code does not add new classes to images under links, although links and images have the same attributes. Any ideas how to fix this issue. Thanks. Cavanshir.
[jQuery] Re: (validate) Customising bassistance validation plugin
Of course, its a jquery expression, what else... However, I do think the docs may be wrong: at http://docs.jquery.com/Plugins/Validation/Methods/required#dependency-expression In the arguments section it reads: An expression (String) is evaluated in the context of the element's form, making the field required only if the expression returns more than one element. Surely that should be one or more elements? Regards - Iwan
[jQuery] jqModal
I've been looking everywhere for an answer to this - I think it might be too obvious and I'm missing something. I'm using jqModal to load (via Ajax) a page of academic references - but I can't get the @href to pick up on the full url of the trigger - ie, it's ignoring everything from # onwards and I want the modal to display only the refence identified by that particular named anchor. My trigger link is: a class=reference href=/~xx/ma-tesol/documents/ references.html#bassano1986reference modal link/a and my jquery is: $(document).ready(function() { $('#refModal').jqm({ajax:'@href', modal:true, target: 'div.jqmAlertContent', trigger: 'a.reference' }); }); As I say this works perfectly, except that it takes me to the top of the document and not the #bassano1986 section of it. Any help much appreciated. Matthew
[jQuery] Re: Create PDF from js
On Nov 9, 12:30 pm, m.ugues m.ug...@gmail.com wrote: The problem using server side option is that I have a web site with a lot of pages. For every page I need to generate a PDF; so I need to create a Java class for every html page where I reproduce the html layout (since the PDF must be the same as the html shown on the screen). If you're using Java, I'd suggest that you use the Flying Saucer project [1], which is an XHTML renderer that can output PDF. You should be able to create the normal HTML output stream from the servlet, passing it into the renderer and stream it out as PDF. Or there could be simpler techniques depending upon how your HTML is generated. Good luck, -- Scott [1] https://xhtmlrenderer.dev.java.net/
[jQuery] Re: Superfish - overlapping Submenu possible?
Problem solved, see http://facility9.com/2008/07/17/ie7-dropdowns-and-z-index .sf-menu li:hover, .sf-menu li.sfHover{ z-index: 99; } instead of .sf-menu li:hover ul, .sf-menu li.sfHover ul{ z-index: 99; }
[jQuery] how to call a toggle on .blur
i have a search icon at the top of my page, when i click this it toggles show/hide on the search form. now when the user loses focus of the search form (.blur), i want it to activate the hide part of the toggle. when the search icon is clicked, it gives focus to the search form, so the moment the icon is clicked, the search form gains focus, then when someone clicks somewhere else on the page and the form loses focus, i want the search form to hide. the problem is, if i just have the search form hide on .blur, then when you click the search icon and then click somewhere else and the search form loses focus, and then you click the icon to show the search form again, it will hide the search form(to the user, it looks like it didn't do anything, since the search form is already hidden). so after 2 clicks on the icon, then, it finally shows the search form again. Here's my code: .searchbutton is the search icon mentioned above. and #search is my Search Form mentioned above. Code: $('.search_button').toggle( function () { $('#search') .stop().animate({left:-5px}, function() {$('#search').focus ();}) }, function () { $('#search') .stop() .animate({left:230px}, 300); }); how do i get it so that when the search form looses focus(.blur), it toggles. How do i do this without breaking the toggle?
[jQuery] jquery form and myfom
hi, jquery form only work if name of form is myform? is correct afirmation? thank´s
Re: [jQuery] jquery form and myfom
On Mon, Nov 9, 2009 at 2:16 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: hi, jquery form only work if name of form is myform? is correct afirmation? there are no such restrictions/limitations. Any page element can have any valid name value (any valid value for any attribute, actually). -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
Re: [jQuery] jquery form and myfom
then... what alternative have? thank´s From: Charlie Griefer Sent: Monday, November 09, 2009 7:18 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] jquery form and myfom On Mon, Nov 9, 2009 at 2:16 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: hi, jquery form only work if name of form is myform? is correct afirmation? there are no such restrictions/limitations. Any page element can have any valid name value (any valid value for any attribute, actually). -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
Re: [jQuery] jquery form and myfom
name your elements with whatever name you want. form name=gustavo id=xyz class=blah can be selected via: $('#xyz') $('.blah') (this will return an array of -all- elements of class blah) $('form') (this will return an array of -all- form elements on the pag) $('form[name=gustavo]') $('form[id=xyz]') $('form[class=blah]') $('form#xyz') Is there a specific question here? On Mon, Nov 9, 2009 at 2:33 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: then... what alternative have? thank´s *From:* Charlie Griefer charlie.grie...@gmail.com *Sent:* Monday, November 09, 2009 7:18 PM *To:* jquery-en@googlegroups.com *Subject:* Re: [jQuery] jquery form and myfom On Mon, Nov 9, 2009 at 2:16 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: hi, jquery form only work if name of form is myform? is correct afirmation? there are no such restrictions/limitations. Any page element can have any valid name value (any valid value for any attribute, actually). -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
Re: [jQuery] jquery form and myfom
ok. thnks´ i treid it. From: Charlie Griefer Sent: Monday, November 09, 2009 7:41 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] jquery form and myfom name your elements with whatever name you want. form name=gustavo id=xyz class=blah can be selected via: $('#xyz') $('.blah') (this will return an array of -all- elements of class blah) $('form') (this will return an array of -all- form elements on the pag) $('form[name=gustavo]') $('form[id=xyz]') $('form[class=blah]') $('form#xyz') Is there a specific question here? On Mon, Nov 9, 2009 at 2:33 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: then... what alternative have? thank´s From: Charlie Griefer Sent: Monday, November 09, 2009 7:18 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] jquery form and myfom On Mon, Nov 9, 2009 at 2:16 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: hi, jquery form only work if name of form is myform? is correct afirmation? there are no such restrictions/limitations. Any page element can have any valid name value (any valid value for any attribute, actually). -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
Re: [jQuery] jquery form and myfom
I want that 10 minutes of my life back... :\ On Mon, Nov 9, 2009 at 2:47 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: ok. thnks´ i treid it. *From:* Charlie Griefer charlie.grie...@gmail.com *Sent:* Monday, November 09, 2009 7:41 PM *To:* jquery-en@googlegroups.com *Subject:* Re: [jQuery] jquery form and myfom name your elements with whatever name you want. form name=gustavo id=xyz class=blah can be selected via: $('#xyz') $('.blah') (this will return an array of -all- elements of class blah) $('form') (this will return an array of -all- form elements on the pag) $('form[name=gustavo]') $('form[id=xyz]') $('form[class=blah]') $('form#xyz') Is there a specific question here? On Mon, Nov 9, 2009 at 2:33 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: then... what alternative have? thank´s *From:* Charlie Griefer charlie.grie...@gmail.com *Sent:* Monday, November 09, 2009 7:18 PM *To:* jquery-en@googlegroups.com *Subject:* Re: [jQuery] jquery form and myfom On Mon, Nov 9, 2009 at 2:16 PM, Lord Gustavo Miguel Angel goosfanc...@gmail.com wrote: hi, jquery form only work if name of form is myform? is correct afirmation? there are no such restrictions/limitations. Any page element can have any valid name value (any valid value for any attribute, actually). -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Div change
Hi, When div id=MyResult/div changes with a AJAX response I would like to fire a alert. What am I doing wrong? $(document).ready(function() { $(#MyResult).change(function (){ alert('hi'); }); });
Re: [jQuery] Div change
On Mon, Nov 9, 2009 at 3:26 PM, factoringcompare.com firstfacto...@googlemail.com wrote: When div id=MyResult/div changes with a AJAX response I would like to fire a alert. What am I doing wrong? $(document).ready(function() { $(#MyResult).change(function (){ alert('hi'); }); }); I think the change event only applies to select and input elements. Most AJAX methods let you specify some sort of callback function to execute. See http://docs.jquery.com/Ajax/ajaxComplete#callback or http://docs.jquery.com/Ajax/load#urldatacallback or http://docs.jquery.com/Ajax/jQuery.getJSON#urldatacallback or (well, you get the point). Point being... you should be able to fire your alert as part of the callback function :) -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
Re: [jQuery] Div change
http://docs.jquery.com/Events/change#fn says : The change event fires when a control loses the input focus and its value has been modified since gaining focus. Sadly a div is not a control and I don't know of a method to do precisely what you're trying to do the way you want to do it. Though if I were you, I'd simply add the behaviour you want to the methods that actually does the change. Michel Belleville 2009/11/10 factoringcompare.com firstfacto...@googlemail.com Hi, When div id=MyResult/div changes with a AJAX response I would like to fire a alert. What am I doing wrong? $(document).ready(function() { $(#MyResult).change(function (){ alert('hi'); }); });
Re: R: [jQuery] Check form before submit with ajax
Hi Salvatore, Thank you for your response. Do you have a basic example to see how to use this function? Regards, BMnt On 7 nov, 10:12, Salvatore FUSTO ing.fu...@gmail.com wrote: Use the $.ajax() function: in it among other you can specify a structure of data to pass to your action page -Messaggio originale- Da: BMnt [mailto:bmonter...@gmail.com] Inviato: venerdì 6 novembre 2009 23.29 A: jQuery (English) Oggetto: [jQuery] Check form before submit with ajax I'm building a web form with containing 3 fields. When the form is submitted a search is done in a database, everything is ok. Now, in order to help the user, I would like to display on the form the number of results he will get if the form is submitted. What's the best way to get this behaviour? With a single field it's quite easy ($.get or $.load), but when I add multiple checkboxes or multiple select, the construction I cannot build the request anynmore... Can someone give me some hints to build my form? Thanks,
[jQuery] jQuery Tabs -- Long content in hidden tabs
I am using jQuery tabs and when I have very long content within the tabs, my browsers scroll bar reflects the content in the tab with the most content. Example, Tab 1 Tab 3 has a very long scroll bar, even though it has no content (because of Tab 2) and you can scroll down through the empty space http://psylicyde.com/misc/tabs-test Is there a way I can hide the content in Tab 2 so that my browsers scroll bar displays correctly in relation to the content in the active tab? -- View this message in context: http://old.nabble.com/jQuery-TabsLong-content-in-hidden-tabs-tp26275988s27240p26275988.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
[jQuery] Benefit of extending jQuery with a function vs. a JavaScript function?
Hello, Marty McGee here. I was hoping to open a discussion about the benefits of extending jQuery with your own custom functions versus simply writing your functions in JavaScript and calling them without extending jQuery first. Please enlighten me and the rest of the humble jQuery library addicts. Thanks to all. For example, this: $(function(){ $.function_name = function test() { alert('in function'); } }); Versus this: $(function(){ test(); }); function test() { alert('in function'); } -
[jQuery] Return key doesn't invoke OK button in JQuery dialog
For some reason, Return key doesn't invoke OK button in JQuery dialog. Any idea what could be the issue?
[jQuery] Plumtree portal
Does anyone have experience in implementing jquery inside of the Plumtree portal (AKA BEA Aqualogic, AKA Oracle Webcenter Suite)? Wendy
[jQuery] How to keep two select items having the same value
Hi all, I have two select tags which have the same options in the different positions of a page: For example, select name=number1 option1/option option2/option option3/option option4/option option5/option /select ... ... select name=number2 option1/option option2/option option3/option option4/option option5/option /select What I want is: When the user choose an item from the number1 select, the number2select will automatically change to the same value to the number2. Is there any one who can provide a solution? Thanks
[jQuery] button with jquery
Hi, I'm having trouble in making an ajax call with an html button. Can anyone answer my questions? Thanks in advance! url: comment.php?id=1 Question 1: how do I get the php variable $_REQUEST['id'] in jquery? Question 2: when I clicked the button, the url goes back to comment.php. How can I make it to go back to comment.php?id=1? Here is the code: html head titletesting/title link rel=stylesheet type=text/css href=../../theme/ stylesheet.css script type=text/javascript src=../../includes/jquery-1.3.2.js/ script script type=text/javascript function submitToggle() { if ($('#submit').css('display') == 'none') { $('#submit').slideDown(); } else { $('#submit').slideUp(); } } function submitCommentToggle() { if ($('#comment-TA').css('display') == 'none') { $('#comment-TA').slideDown(); } else { $('#comment-TA').slideUp(); } } //add click handler for button $(#comment_add).click(function() { //alert($.post('id')); //define ajax config object var ajaxOpts = { type: post, url: addComment.php, data: author= + $(#comment-TA).find(input).val() + comment= + $(#comment-TA).find(textarea).val() + id=1 //need to replace with $REQUEST['id'] //success: function(data) { //alert(succeed!); //create a container for the new comment //var div = $(div).addClass(print-comment).appendTo (#comments-section); }; //$.ajax(ajaxOpts); }); //}); /script /head div class=Comments div class=comment_buttona href=javascript:submitCommentToggle () class=comment_buttonAdd a Comment/a/div body div id=comment-TA div class=row labelName:/labelinput type=text/ /div form class=comment-textbox textarea/textareabr / button id=comment_add Comment /button /form /div div id=comments-section div class=print-comment labelname:/label div class=printed-comment-msgmessage/div /div /div /div /body Thanks, Chuck.
[jQuery] Re: jQuery Tabs -- Long content in hidden tabs
If this is UI Tabs you should ask in the jQuery UI group.
[jQuery] Re: How to keep two select items having the same value
What I want is: When the user choose an item from the number1 select, the number2select will automatically change to the same value to the number2. Maybe something like this? $(select[name=number1]).change(function(){ $(select[name=number2]).val( $(this).val() ); }); If the change event doesn't do it for you, take a look at .click() or .blur().
[jQuery] Re: Return key doesn't invoke OK button in JQuery dialog
For some reason, Return key doesn't invoke OK button in JQuery dialog. Any idea what could be the issue? Do you have some simple code demonstrating the problem? If the OK button is a submit button in a form this generally should work, but an example would be good.
Re: [jQuery] Re: How to keep two select items having the same value
On Mon, Nov 9, 2009 at 4:06 PM, Dave Methvin dave.meth...@gmail.com wrote: What I want is: When the user choose an item from the number1 select, the number2select will automatically change to the same value to the number2. Maybe something like this? $(select[name=number1]).change(function(){ $(select[name=number2]).val( $(this).val() ); }); If the change event doesn't do it for you, take a look at .click() or .blur(). change() oughtta do it. What you have there should work perfectly. -- Charlie Griefer http://charlie.griefer.com/ I have failed as much as I have succeeded. But I love my life. I love my wife. And I wish you my kind of success.
[jQuery] Re: Benefit of extending jQuery with a function vs. a JavaScript function?
Hello, Marty McGee here. I was hoping to open a discussion about the benefits of extending jQuery with your own custom functions versus simply writing your functions in JavaScript and calling them without extending jQuery first. I am not a fan of extending the jQuery object with unrelated application-specific functionality. It avoids polluting the global namespace, but then again it pollutes the jQuery namespace. If jQuery later tries to claim that name for its own uses, you'll have a conflict.
[jQuery] Cascade plugin and multiple selected values
Hello to all I using the cascade plugin in 3 dropdowns and it works fine, but in some ocasions I need to pre selected the values because the user is editing the previous recorded selections. I manage to selected the value of the first dropdown with the following code: $('#chained [value=1').attr('selected','selected').parent().change(); but how can I selected the second one and the third? I tried this: script type=text/javascript function startDrops() { $('#chained [value=1]').attr('selected','selected').parent().change (); $('#chained_child [value=3]').attr('selected','selected').parent ().change(); } /script ... body onload=Javascript:startDrops(); But it didn't work.. How can I do it? Thanks
[jQuery] Reloading Problem
Hey guys, I'm working on a status-Updater. It works, there is just one problem, after sending a Status I have to manual reload the page to let the script work again. Do you can help me please? Here's the code: script language=javascript $(document).ready(function(){ $(form#status_form).submit(function(){ var s_autor = $('#s_autor').attr('value'); var s_status= $('#s_status').attr('value'); $.ajax({ type: POST, url: /admin/request.php, data: s_autor=+ s_autor + s_status=+ s_status, success: function(){ $('#show').load(/admin/request.php).fadeIn (slow, function(){ setTimeout(function(){ $(function() { $(#show).fadeTo (slow, 0.01, function(){ $ (this).slideUp(slow, function() { $ (this).remove(); }); }); }); }, 2000); }); }, }); return false; }); }); /script So do you know how to code it to make it possible to repeat the script how often I click on the submit button? By the way, here's the HTML-Form: form id=status_form method=post action=request.php onsubmit=return false; input type=text id=s_autor name=s_autor value=?= $user_id; ? style=display: none; /input type=text id=s_status name=s_status value=Statusnachricht /input type=submit value= class=submit id=status_submit / /form Well, the file request.php is looking like this (in the moment!): div class=inhaltdiv class=textErfolgreich eingetragen!/div/ div The PHP-Part is coming up. I want to reach that if I click on the submit-Button, the jquery-code works. Well, it works, but just ONE TIME. After clicking the first time on the submit-button, the script SHOULD work like it did the first time. But if I click on the submit button the second time, nothing works. Anyway: I want the script work as often I click on the submit button Hope you understand me. My english is not the best... (I'm german...)
[jQuery] Re: jquery form and myfom
I want that 10 minutes of my life back... :\ Ha ha. Love it!
[jQuery] URGENT!!! Need Help!!! IE bug in carousel3d plugin on image animation click after ajax call
I have a IE bug in carousel3d plugin on image click animation after ajax call. The ajax call return a new set of images html tags, but only in internet explorer, when click on a new image. The animation start and go back at it initial position. here the link of my site -- http://www.afhrgolive.com/newVersion_AFHRGoLive/salon_virtuel_db.php (to see the bug, click on Navigation - Guide and click on the escalator icon...and after click on a image (not on the boxcaption, but click on the image directly, I'll fix that later), you'll see what happen) I used IE7, firefox and others browser is working correctly. Here a link to my carousel3d plugin ( http://www.afhrgolive.com/newVersion_AFHRGoLive/jquery/jquery.carouse... ) and here are my call function to change level. script type=text/javascript function changeLevel(floorLevelID) { //remove carousel (free element from memory) jQuery(function($) { $(#carousel).html($(#holder_images).html ()).carousel3d( {control: 'buttons', speed:1, fadeEffect:1, textBox:1, centerX: $('#carousel').offset().left + $('#carousel').width()/2.5, centerY: 425, remove: 1 } ); }); //$(#holder_images).empty(); //$(#carousel).empty(); $(#holder_images img).remove(); $(#carousel img).remove(); $(#text).empty(); $(#text_boxcaption_img).empty(); $(#carouselText).empty(); $(#carouselTextBoxCaptionImg).empty(); //Get the new html for holder_images tag. $.ajax({ url: salon_virtuel_change_floor_level.php?floorID= + floorLevelID + tag=holder_images, dataType: html, cache: false, async: false, success: function(html){ $(#holder_images).append(html); } }); //Get the new html for carouselText tag. $.ajax({ url: salon_virtuel_change_floor_level.php?floorID= + floorLevelID + tag=carouselText, dataType: html, cache: false, async: false, success: function(html){ $(#carouselText).append(html); } }); //Refresh the carousel jQuery(function($) { $(#carousel).html($(#holder_images).html ()).carousel3d( {control: 'buttons', speed:1, fadeEffect:1, textBox:1, centerX: $('#carousel').offset().left + $('#carousel').width()/2.5, centerY: 425 } ); }); //close menu after changing floor Level $(#sliding_box_nav_menu2).stop().animate({top:'610px'}, {queue:false,duration:300}); $(#container_nav_menu2).hide(); } /script If anyone can help me has soon as possible, I will really appreciate that. Thank you very much in advance for your help.
[jQuery] Re: URGENT!!! Need Help!!! IE bug in carousel3d plugin on image animation click after ajax call
Here the corrected link for my carousel3d plugin -- http://www.afhrgolive.com/newVersion_AFHRGoLive/jquery/jquery.carousel3d.js
[jQuery] jquery form...
hi. i´m try with this example: http://www.malsup.com/jquery/form/#json but Alert(data.message) return undefinited why? tk-.
Re: [jQuery] jquery form...
Why? Simple. Because the variable does not exist. :D On Mon, Nov 9, 2009 at 7:09 PM, Lord Gustavo Miguel Angel wrote: hi. i´m try with this example: http://www.malsup.com/jquery/form/#json but Alert(data.message) return undefinited why? tk-.
[jQuery] cloning a canvas
Hi all, Does anyone know if this is possible? I'm using the jqplot plugin to create graphs on my page, and when a user clicks on a button, I want to duplicate the graph in a new window so they can print it by itself. I'm doing it right now by opening a new window and appending the original plot, but that removes the plot from the parent page (I guess I could just recreate the plot). Cloning the plot doesn't seem to work as it only clones the canvas tags and not the graph information... Thanks.
Re: [jQuery] jquery form...
i don´t understand i write this: ?php echo '{ message: ' . $_POST['message'] . ' }'; ? From: Matt Quackenbush Sent: Monday, November 09, 2009 10:20 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] jquery form... Why? Simple. Because the variable does not exist. :D On Mon, Nov 9, 2009 at 7:09 PM, Lord Gustavo Miguel Angel wrote: hi. i´m try with this example: http://www.malsup.com/jquery/form/#json but Alert(data.message) return undefinited why? tk-.
Re: [jQuery] jquery form...
My error. original code: $('#jsonForm').ajaxForm({ // dataType identifies the expected content type of the server response dataType: 'json', My code: $('#jsonForm').ajaxForm({ // dataType identifies the expected content type of the server response datatype: 'json', (look datatype original dataType' upcase(T) tk From: Matt Quackenbush Sent: Monday, November 09, 2009 10:20 PM To: jquery-en@googlegroups.com Subject: Re: [jQuery] jquery form... Why? Simple. Because the variable does not exist. :D On Mon, Nov 9, 2009 at 7:09 PM, Lord Gustavo Miguel Angel wrote: hi. i´m try with this example: http://www.malsup.com/jquery/form/#json but Alert(data.message) return undefinited why? tk-.
Re: [jQuery] making images cycle with clueTip
I'm not sure I follow what you're trying to do. Do you have a test page that shows what you've done so far? --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 5, 2009, at 3:37 PM, Jack wrote: Hello, is it possible to use clueTip to cycle images. I used jcycle to make a slide show based on images in an html page. That works fine. Now I would like these images to appear in a clueTip. I tried the clueTip feature that allows you to include a web page so I included the web that uses jcycle with the images but it does not work. Thanks. Jacques
Re: [jQuery] how do i prevent having a paragraph tag for the text AFTER i expand?
it would be helpful to see a page with the html output rather than your php variables. Also, try using a span rather than a div for the expandText. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Nov 5, 2009, at 6:04 AM, Kei Simone wrote: Hi i noticed that whenever i expanded the text, the subsequent text expanded. and the expand prefix... also tends to be on the next line. Please advise. This is my expand code. $(document).ready(function() { // override some default options $('div.expandable div').expander({ slicePoint: 160, // default is 100 expandText: 'div class=expand- buttonnbsp;nbsp;nbsp;nbsp;nbsp;Expand/div', // default is 'read more...' //expandSpeed: '2000', // speed in milliseconds of the animation effect for expanding the text //expandPrefix: '...', expandEffect: 'fadeIn', collapseTimer:0, // re-collapses after 5 seconds; default is 0, so no re-collapsing userCollapseText: 'Collapse' , // default is '[collapse expanded text]' afterExpand: function($thisElement) { var vendorParaID = $thisElement.attr('id'); var underscore = vendorParaID.indexOf('_'); var vendorID = vendorParaID.substring(0, underscore); $(#vendor_img_+vendorID).replaceWith($preloadImgVendor [vendorID]); var heightOfDIV = $thisElement.height(); if(heightOfDIV 290){ $thisElement.attr({style : height:290px;overflow:auto}); } //console.debug($thisElement); }, onCollapse: function($thisElement, byUser) { //alert($thisElement.attr('id')); var vendorParaID = $thisElement.attr('id'); var underscore = vendorParaID.indexOf('_'); var vendorID = vendorParaID.substring(0, underscore); $(#vendor_img_+vendorID).replaceWith($preloadImgVendorCrop [vendorID]); var heightOfDIV = $thisElement.height(); if(heightOfDIV 68){ $thisElement.removeAttr(style); } //console.debug($thisElement); } }); }); This is my div for the expandable. div class=expandable div id={$vender.id_manufacturer} _desc{$vender.description}/div /div
[jQuery] [Treeview] Manually toggling a node
I've been working with Jörn Zaefferer's treeview control, and overall have found it great. But I am having problem, not as much with dynamically adding items, but getting them to properly display once they are added. My treeview is something like this: Level 1 Item (open) Level 2 Item (open) Level 3 Item (closed) Level 3 Item (closed) Level 2 Item (open) Each of the level 2 items have an add icon that lets me add a Level 3 item. I am actually able to add the item (under Firefox 3.5.5, trying to get it work with IE6) with success to the treeview, except for 2 things. A) If I click on the Level 3 add icon item, to add a Level 4 item, I cannot expand the treeview to see the new Level 4 Item I created. B) The treeview does not automatically expand my new Level 3 item, once I've clicked on the Level 2 add icon.
[jQuery] Re: jQuery $.get callback function not being called
Hello Michel, Thank you very much for your help. I've used Firebug to verify that json_encode($tweets) outputs json data. But on another php discussion thread, they suggested to really verify that only json data is being encoded, without spaces before and after the data. So I'm going to go through that investigation today. Thanks again! Regards, Arnie On Nov 8, 10:44 pm, Michel Belleville michel.bellevi...@gmail.com wrote: Well no, no-store, no-cache, must-revalidate is exactly what you need here. If you had cache your problem could have been that the cache was keeping a former result from when you didn't output the result. You should check wether you get something in the reply, and if not ask yourself why your PHP script doesn't output anything (my best guess at this point would be that get_tmmtweets($east, $south, $west, $north, $mood); returns nothing that json_encode() likes, if anything), though I don't know get_tmmtweets and I guess I can't help you much here. Michel Belleville 2009/11/9 ArnieML arnie.lapi...@gmail.com I tried echo json_encode($tweets); and still no callback function. The XMLhttp response header looks like this: Date Mon, 09 Nov 2009 00:57:25 GMT Content-Type text/html Connection close Server Apache X-Powered-By PHP/5.2.1 Expires Thu, 19 Nov 1981 08:52:00 GMT Cache-Control no-store, no-cache, must-revalidate, post-check=0, pre- check=0 Pragma no-cache Content-Length 20283 Is the Cache-Control setting of no-store, no-cache a possible problem? Regards, Arnie On Nov 8, 11:14 am, Michel Belleville michel.bellevi...@gmail.com wrote: Well the doc suggests http://php.net/manual/fr/function.json-encode.phpthat json_encode doesn't change the variable passed as a parameter but returns the encoded string so you've got to do something like this : echo json_encode($tweets); To get a jason encoded serialisation of your data output in the response and not : json_encode($tweets); echo $tweets; Which would only output $tweets not encoded. Though if it doesn't work like I tell you, you'd better worry about something else and I don't know exactly what at this point. Michel Belleville 2009/11/8 ArnieML arnie.lapi...@gmail.com Hi Michel, I added the following statement after json encoding: echo $tweets; to the PHP, but the callback function still isn't getting called. Any other ideas? Thanks for the help. On Nov 7, 11:20 pm, Michel Belleville michel.bellevi...@gmail.com wrote: It's been a long time since my last PHP days but shouldn't you echo or print something to get it sent ? It seems you'd get an empty response here (unless json_encode already outputs the answer to the response). And as you expect at least a bit of json to run through and output parts of, your callback may be called but not do anything about the empty response. Hope it helps. Michel Belleville 2009/11/8 ArnieML arnie.lapi...@gmail.com Hello, I hope someone can help. I'm issuing the following ajax jquery call: $.get(/ajaxtest.php, { ajax: true, east: northEast.lng(), west: southWest.lng(), north: northEast.lat(), south: southWest.lat(), mood: amood }, function (data) { for(var i=0; idata.length; i++){ alert(now processing tweets); display_tmmmarker(map, data[i], i); } $(#gettingtweets).remove(); }, 'json'); The PHP page looks like this: if ( $_REQUEST['ajax'] == 'true' ) { $east = $_REQUEST['east']; $south = $_REQUEST['south']; $west = $_REQUEST['west']; $north = $_REQUEST['north']; $mood = $_REQUEST['mood']; $tweets = get_tmmtweets($east, $south, $west, $north, $mood); json_encode($tweets); } exit; I have verified that the $tweets array has been JSON-encoded using array_values. But the callback function isn't being invoked. I put in an alert statement in the callback to verify if the function has been called, but I'm not getting the alert message. Is the $tweets array not being passed on for some reason? Can someone help out? Thanks very much!
[jQuery] tablesorter + AJAX
Hey there, I've read through several AJAX+tablesorter posts and am still a little confuzzled on this. I am loading an entire table into a div like so: div id=mainContent pLoading.../p /div script type=text/javascript $(document).ready( function() { $.get('/ajaxRates',{}, function(data) { $('#mainContent').html(data); $('#ratesTable').tablesorter(); }); }); /script The /ajaxRates URL returns the HTML table. I place it into the div using the function right after it. I then call that new table and apply tablesorter() to it. If I do this to an inplace table, it works fine. It's just the AJAX table I'm having trouble with. The new table should be fully in the DOM by the time that function returns correct? Is there some other event I need to wait for or attach somehow in order to get this to work correctly? Thanks Sumit Khanna http://penguindreams.org -- View this message in context: http://old.nabble.com/tablesorter-%2B-AJAX-tp26278194s27240p26278194.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Calling function in jQuery
Hi all, Now I am able to call jQuery functions from other blocks. Please help me in solving this one also. I have a form with select option. It will be populated dynamically after every ajax request. In form, I have a select tag with no options. select id='users' /select After getting a content from ajax, I am preparing all the available options, and placing that content in select tag. var opts = option value='1'Murali/option option value='2'Krishna/option; $(#users).html(opts); But it is not showing any options in the select tag. Thanks, Murali. On Mon, Nov 9, 2009 at 6:24 PM, Dhruva Sagar dhruva.sa...@gmail.com wrote: The function by itself will not be available within other blocks, since the function is in local scope. You should attach the function to the jQuery object instead for later use using the following syntax : (function($) { $.function_name = function test() { alert('in function'); } })(jQuery); Then later in other jQuery blocks (although you will have to ensure that your previously defined block has been already included) you can call your function simply by using $.function_name(); Thanks Regards, Dhruva Sagar. On Mon, Nov 9, 2009 at 4:27 PM, Murali Krishna B muralikrishna.vi...@gmail.com wrote: Hi all, I am creating a function using jQuery in application.js file. (function($) { function test() { alert('in function'); } })(jQuery); When I am trying to call this function from outside (not in this jQuery block), I am getting an error saying that function is not defined. I am including this file, also I am calling this function from a jQuery block. Still I am getting this error. How to call that function? Also, I am facing another issue. I have a form with select option. It will be populated dynamically after every ajax request. In form, I have a select tag with no options. select id='users' /select After getting a content from ajax, I am preparing all the available options, and placing that content in select tag. var opts = option value='1'Murali/optionoption value='2'Krishna/option; $(#users).html(opts); But it is not showing any options in the select tag. Pls help me, -- Thanks Regards, Murali Krishna.B -- Thanks Regards, Murali Krishna.B
Re: [jQuery] making images cycle with clueTip
Jack wrote: Hello, is it possible to use clueTip to cycle images. I used jcycle to make a slide show based on images in an html page. That works fine. Now I would like these images to appear in a clueTip. I tried the clueTip feature that allows you to include a web page so I included the web that uses jcycle with the images but it does not work. As a guess, and without going back to look at clueTip's implementation, have you forgotten to initialize the slide show after the clueTip's html loads? Something like this (entirely untested) code?: $(selector).clueTip({onShow: success: function(data, status) { $(cycleDiv, selector).cycle(); }}); Good luck, -- Scott
[jQuery] jQuery Logic - Three elements used to cycle information
Hi, I'm hoping I can get a bit of help with a logic issue. I have a horizontal-scrolling content element (similar to http://www.ndoherty.biz/demos/coda-slider/1.1.1/#2 this ). It uses three DIVs with three classes - prev, current, and next. The elements' contents are loaded from an XML file of hundreds of items. With each navigational command (i.e. a 'next' link that slides the three elements to the left to show the 'next' element), the prev/next DIVs are emptied and re-filled with the correct content from the XML. The problem I have is with re-assigning classes to the elements to reflect their new positions. Here's the code: $('#name.current').removeClass('current').addClass('prev'); $('#name.next').removeClass('next').addClass('current'); $('#name.prev').removeClass('prev').addClass('next'); I'm sure you can see the issue. I have to change the class of all three elements, but the third line presents an issue. Then it runs, TWO elements have the .prev class. It will effectively reverse itself. So you can see the issue. I'm looking for an alternate technique or idea here. Your input is greatly appreciated, thanks for your time! -- View this message in context: http://old.nabble.com/jQuery-Logic---Three-elements-used-to-cycle-information-tp26278847s27240p26278847.html Sent from the jQuery General Discussion mailing list archive at Nabble.com.
Re: [jQuery] Re: Benefit of extending jQuery with a function vs. a JavaScript function?
I'd say extend jQuery when you're writing generic plugins that may be reused in another context, your application-specific code has no business extending jQuery. Michel Belleville 2009/11/10 Dave Methvin dave.meth...@gmail.com Hello, Marty McGee here. I was hoping to open a discussion about the benefits of extending jQuery with your own custom functions versus simply writing your functions in JavaScript and calling them without extending jQuery first. I am not a fan of extending the jQuery object with unrelated application-specific functionality. It avoids polluting the global namespace, but then again it pollutes the jQuery namespace. If jQuery later tries to claim that name for its own uses, you'll have a conflict.