[jQuery] Re: Using Zend IDE with jquery
zend with eclipse has some plugins. I don't use them though, so I'm not sure where to get them. On Jun 12, 2:13 pm, Arun arun5672...@yahoo.com wrote: Hi, Has anyone ever tried using the zend ide with jquery? Any comments on this would be appreciated. Arun
[jQuery] Re: New Plugin: jQuery Finder (Mac-style 'Treeview' with Columns)
Hello all, I am working on a new version for this plugin to tackle the problems mentioned here and those received by email. I created a new group for this plugin to better organise this project. Here I describe the current status and where it is going: http://groups.google.com/group/jqueryfinder/browse_thread/thread/62358226be1ff4fa Please post at the new group for all questions and feedback regarding this plugin. http://groups.google.com/group/jqueryfinder
[jQuery] superfish NAVBAR menu - click on lowest menu and highlight that path
Hi, The superfish NAVBAR menu is exactly what I am looking for. The only addition I need is that when I click on a different bottom level node the path that is highlighted changes to the path of the item I have clicked on. Does anyone know how to do that thanks Touran
[jQuery] Event Load() ??
Hello, I'm with a doubt in jquery, I am using the function load () to call another page, but after I loaded this page, I can not use the id of another page. because the function $('#btnCadastrarCliente').click does not work? [index.php] script $(document).ready(function(){ $('#btnCadastrarCliente').click(function() { alert(ok); }); $('#novoCliente').click(function() { mostrarCarregando(); $('#conteudo').load(cadastroCliente.php); }); }); /script lispan class=clienteCliente/span ul lispan class=filea href=# id=novoClienteNovo Cliente/a/span/li /ul /li [cadastroCliente.php] form name=etc id=form input type=text name=nome id=nome / input type=button value=Cadastrar id=btnCadastrarCliente/ /form
[jQuery] Event Load() ??
Hello, I'm with a doubt in jquery, I am using the function load () to call another page, but after I loaded this page, I can not use the id of another page. because the function $('#btnCadastrarCliente').click does not work? [index.php] script $(document).ready(function(){ $('#btnCadastrarCliente').click(function() { alert(ok); }); $('#novoCliente').click(function() { mostrarCarregando(); $('#conteudo').load(cadastroCliente.php); }); }); /script lispan class=clienteCliente/span ul lispan class=filea href=# id=novoClienteNovo Cliente/a/span/li /ul /li [cadastroCliente.php] form name=etc id=form input type=text name=nome id=nome / input type=button value=Cadastrar id=btnCadastrarCliente/ /form
[jQuery] calling functions within a jQuery plugin from another script
Hi all and thanks in advance for your help, I am creating a plugin (named - autoFormat) using the classic plugin style (see below). Can I call the sub function stripFormat from another script? If not how can I modify the plugin that will allow me to call this from another script? Bob (function($){ var p = $.extend({ aNum: '0123456789', cPos: 0 }); $.fn.extend({ autoFormat : function() { // plugin name return this.each(function() { $(this).keypress(function (e){ //code goes here }); function stripFormat(ie){ // sub function //code goes here } }); } }); })(jQuery);
[jQuery] Re: textarea chars counter
If someone gets here at any time, the solution is http://stackoverflow.com/questions/686995/jquery-catch-paste-input On Jun 12, 2:43 pm, dreame4 91drea...@gmail.com wrote: Thanks for your accurate remark. I came up with adding some event but I don't know which. Focus doesn't work as I want to. It doesn't update counter immediately after pasting text. Until after leaving input. Just as focus event works. Some other ideas? On 12 Cze, 14:35, MorningZ morni...@gmail.com wrote: But id doesn't work when I click the right mouse button on it and choose Paste And this should be easy as cake to understand: Copy and Paste will *not* fire the keyup event which your code is requiring You'll need to wire that event to more events to make it work with CP (focus would come to mind) On Jun 12, 7:40 am, dreame4 91drea...@gmail.com wrote: Hi, I need to count characters in textarea so I wrote sth like this: $input.keyup(function() { var new_length = $(this).val().length; $word_counter.text(new_length); if(new_length = min new_length = max) { $word_counter.addClass('git'); } else { $word_counter.removeClass('git'); } }); But id doesn't work when I click the right mouse button on it and choose Paste. Counter is not updated. Can anyone help? Thanks, Adam
[jQuery] ajax Menu help
hello dears , how can i make same as this top menu : see this website : http://www.gettyimages.com/ plz help me son regards -- Eng. Nader Dasuqi Project Manager +9665339217533
[jQuery] Re: tables and chairs app
Take a look at jQuery UI for the drag and drop and resize features: http://jqueryui.com/demos/draggable/ http://jqueryui.com/demos/droppable/ http://jqueryui.com/demos/resizable/ Since you mention rotating, I think you're on the right track with thinking of using canvas. You could have little rotation arrows that appear at the corners on hover, and using the draggable plugin, make them rotate the canvas when dragged in a circle. - Richard On Fri, Jun 12, 2009 at 8:55 PM, Jack Killpatrick j...@ihwy.com wrote: Hi All, I'm thinking out how to put together a web app that allows a user to have a room and in that room, place tables and chairs, which will then be used for a scheduling app. The scheduling part I'm on top of. The graphical part for positioning tables and chairs is what I'm looking for a good solution to. At minimum the user has to be able to drag/drop and rotate the tables and chairs, to position them in a way that resembles the real room. Ideally, they should be able to either resize the table (drag sides of a rectangle or enlarge a circle) or, less desirably, I could give them a set of different tables to choose from (or both). Right now I'm thinking of using canvas and looking into jQuery plugins. Any pointers? Thanks, Jack
[jQuery] Re: jQuery Conference for 2009?
I sent a tweet to Karl a few weeks ago, he replied I'm pretty sure you can count on there being a jQuery conf again. Just not sure about any of the details yet. Didn't mention anything about Guinness though, heh heh... oh wait, that's not this conversation On Jun 12, 5:19 pm, ak732 ask...@gmail.com wrote: Any word on the much-anticipated jQuery conference 2009?
[jQuery] Re: Replace content with title attribute value
Brilliant, thanks a lot. Here is the final script that does exactly what I wanted: $(.date).each( function (i) { var formattedDate = $(this).attr('title'); $(this).html(formattedDate); }); $('.date').removeAttr(title);
[jQuery] Re: jquery.animate with className only
jQuery UI has this feature as well: http://docs.jquery.com/UI/Effects/ClassTransitions http://jqueryui.com/demos/addClass/ http://jqueryui.com/demos/removeClass/ http://jqueryui.com/demos/toggleClass/ - Richard On Fri, Jun 12, 2009 at 3:11 PM, amuhlou amysch...@gmail.com wrote: This got me curious and after a little digging I find a plugin called animateToClass http://igorvieira.com/blog/animate-to-class-en It seems to be what you're looking for. cheers, ~amy On Jun 12, 2:04 pm, DiggityDan edn...@gmail.com wrote: I'm new to Jquery and I was wondering if this feature exists anywhere. the animate() function where instead of parameters you pass in a classname and it reads the parameters from available css definitions. I am trying to keep my css specifics out of my javascript files.
[jQuery] Re: jQuery Conference for 2009?
Hopefully it's up in Boston again, either right before/after AJAX Experience. Makes things simple. And it's Boston, you know; lots of Irish bars serving Guinness on tap. jQuery/AJAX/Guinness, could there be a happier place?
[jQuery] Re: Plugin API the jQuery way
jQuery UI Progressbar makes for an extremely simple example: http://jquery-ui.googlecode.com/svn/trunk/ui/ui.progressbar.js Other than what's provide by the widget factory in jQuery UI core, it has just one option (value), one method (value), and one event (change). You may also want to check out: http://bililite.com/blog/understanding-jquery-ui-widgets-a-tutorial/ If you have any other questions, note that there's a dedicated list for jQuery UI: http://groups.google.com/group/jquery-ui - Richard On Fri, Jun 12, 2009 at 3:15 PM, Christopher cpiet...@gmail.com wrote: Hei there, since http://marcgrabanski.com/article/jquery-tools-vs-jquery-ui it isn't nice to make your own plugin api. Now i am trying to build a plugin api for a pagination in the jquery ui way - llike that $myDiv.pagination('click', function(){ ... }); but the whole ui construct with core and so on don't let me see the way i have to implement the api. does somebody know an easy plugin where i could spy in ? thx chris
[jQuery] Re: DivMenu
get better response with a link to see the problem, jsbin works great , has built in script libraries including jquery Glazz wrote: nobody can help me out?
[jQuery] Re: Event Load() ??
It couldn't possibly work because the javascript isn't there. Add the code to cadastroCliente.php. On Fri, Jun 12, 2009 at 10:24 PM, Frankfrankbe...@gmail.com wrote: Hello, I'm with a doubt in jquery, I am using the function load () to call another page, but after I loaded this page, I can not use the id of another page. because the function $('#btnCadastrarCliente').click does not work? [index.php] script $(document).ready(function(){ $('#btnCadastrarCliente').click(function() { alert(ok); }); $('#novoCliente').click(function() { mostrarCarregando(); $('#conteudo').load(cadastroCliente.php); }); }); /script lispan class=clienteCliente/span ul lispan class=filea href=# id=novoClienteNovo Cliente/a/span/li /ul /li [cadastroCliente.php] form name=etc id=form input type=text name=nome id=nome / input type=button value=Cadastrar id=btnCadastrarCliente/ /form
[jQuery] [ lCarousel Lite ] Can't drag items outside Carousel
Hello, I'm trying to merge Carousel and Drag functions, but I'm facing problem. Here is the jCarousel lite page : http://www.gmarwaha.com/jquery/jcarousellite/ And here is my project : http://www.wir3d.net/tests/carousel_drag_02.html Carousel pager works great, when you click a page, carousel switch to the chosen page. But if you try to drag an item outside the carousel (green border), the item won't go above the carousel border, but underneath. Did someone already face this problem ? Any idea how to solve that ?
[jQuery] Re: Using Zend IDE with jquery
I gave up with eclipse in favour of netbeans. However this is for Eclipse PDT but uses 1.2.6 http://www.langtags.com/jquerywtp/ The netbeans jquery addon also uses 1.2.6 I wonder how much of a chore it would be updating them to 1.3.2? I have not looked into doing it - S 2009/6/13 Josh Powell seas...@gmail.com zend with eclipse has some plugins. I don't use them though, so I'm not sure where to get them. On Jun 12, 2:13 pm, Arun arun5672...@yahoo.com wrote: Hi, Has anyone ever tried using the zend ide with jquery? Any comments on this would be appreciated. Arun
[jQuery] Re: Find the height of a div, apply the height to other divs, redo the heights on click
The container DIV should stretch by itself, you shouldn't need any calculations. If the inner DIVs are floated, just make the outer one floated too and it will expand to fit. And you can't get styles before any styles are applied, doesn't make sense right? :) What you can do is append a clone of them to an absolutely positioned DIV with visibility:hidden to get the heights. On Jun 12, 4:35 pm, Dave dave.mer...@gmail.com wrote: I am working on a UI that, when you click on a menu option, a div opens and show three divs inside. These divs all have different heights. The heights are based on the divs content. The problem I'm having is... how do I measure what the divs height should be? IE, how do I grab the height for a div BEFORE it has had any style applied to it. Any ideas? Lemme know. Dave
[jQuery] blockUI does work
Hi all, I tried on blockUI and the below doesn't work? Any help please? Thanks. html head link rel=stylesheet href=styles.css type=text/css media=all script src=jquery.js/script script src=jquery.blockUI.js/script script $(document).ready(function() { $(div#menu li).click(function() { $('div.blockMe').block({ message: null }); var type = ($(this).attr(id)); $(this).toggleClass(selected); $(this).siblings(li).removeClass(selected); var img = new Image(); $(img).load(function () { $(this).hide(); $('#locationmap').html(this); $(this).fadeIn(); }).error(function () { $('#locationmap').html('No image loaded'); }).attr('src', type+'map.jpg'); }); }); /script script type=text/javascript $(document).ready(function() { $('#blockButton').click(function() { $('div.blockMe').block({ message: null }); }); $('#blockButton2').click(function() { $('div.blockMe').block({ message: 'h1Processing.../h1', css: { border: '3px solid #a00' } }); }); $('#unblockButton').click(function() { $('div.blockMe').unblock(); }); $('a.test').click(function() { alert('link clicked'); return false; }); }); /script /head body p input id=blockButton type=submit value=Block / input id=blockButton2 type=submit value=Block with Message / input id=unblockButton type=submit value=Unblock / /p div id=menu ul li class=selected id=sabahspanSabah/span/li li id=kkspanKota Kinabalu/span/li li id=labuanspanLabuan/span/li /ul /div div id=locationmap class=blockMeimg id=mapimage src=sabahmap.jpg/img/div /body /html
[jQuery] Re: DivMenu
http://jsbin.com/ekaqe First click Euro (€), then a div shows up, the first problem is that if you click on the div, the div closes itself, and the other problem is, if you have 2 links to open divs they don't close itself, i need to click on the document page to close them Here is the JS: jQuery.fn.DivMenu = function(opcoes){ /** * Valores de defeito. **/ var variaveis = { 'display' : 'none', 'position': 'absolute', 'background' : '#fff', 'border' : '1px solid #cecece', 'font-family' : 'Verdana, Arial, Helvetica, sans-serif', 'font-size' : '11px; padding: 5px; z-index: 99' }; var opcoes = $.extend({}, variaveis, opcoes); /** end **/ /** * **/ return this.each(function(){ /** * Declarar variaveis. **/ var element = this; var offset = $(element).offset(); var left = offset.left; var top = offset.top; var currentId = $(this).attr('id'); var divDados = currentId + '-dados'; /** end **/ /** * **/ $(element).click(function(){ $('#' + divDados).hide(); $(this).next ().show(); return false; }); $(document.body).click(function(){ $('#' + divDados).hide(); }); /** end **/ /** * **/ $('#' + divDados).css({ 'left': left + 'px', 'top' : top + 15 + 'px', 'display' : opcoes['display'], 'position': opcoes['position'], 'background' : opcoes['background'], 'border' : opcoes['border'], 'font-family' : opcoes['font-family'], 'font-size' : opcoes['font_size'] }); /** end **/ }); /** end **/ }; On 13 Jun, 14:42, Charlie charlie...@gmail.com wrote: get better response with a link to see the problem, jsbin works great , has built in script libraries including jquery Glazz wrote:nobody can help me out?
[jQuery] jquery scripts only work linking to another site - looking for these downloads
Hello I saw an example of an image slider I would like to use ( or am using). THe code requires javascript and css and my problem being is that even though I downloaded the javascript and css files - jquery. lavalamp stuff - it is not working unless I link to the site of which I originally saw the example I have tried everything .inc files - absolute links but it only works giving the other site credit in a way - I am sorry to do this and dont want to.. I have the files.. I can see them .. I can edit them and they reside on the remote server What could possibly be wrong? example script type=text/javascript src=http://www.hisite/js/ jquery-1.3.2.min.js/script works script type=text/javascript src=http://www.mysite/js/ query-1.3.2.min.js/script doesnt work looking for these scripts query-1.3.2.min.js easySlider1.5.js jquery.easing.min.js jquery.lavalamp.js jquery.lavalampfunction.js easycall.js Rob Thanks!
[jQuery] anonymous function and code reusing
Hi guys, apologize for posting again the same topic. I haven't found a solution yet for my simple problem. I have a simple function that works when a link is clicked $(document).ready(function(){ $("#moon").click(function(){ alert("do something"); }); }); I need to reuse that function passing a parameter so I modified the function like that $(document).ready(function(){ $("#moon").click(myFunction("param")); $("#earth").click(myFunction("param2")); function myFunction(param){ alert(param); } }); I thought it should have worked but it doesn't. In fact, when the page has loaded even without clicking the first and second istructions are executed: $("#moon").click(myFunction("param")); $("#earth").click(myFunction("param2")); whereas with the following case $("#moon").click(function(){ alert("do something"); }); the function need to be activate by a click any idea? Thanks a lot c
[jQuery] Show/hide divs depending on form parameters
Hi all, I am pretty new to jQuery, and I'm looking for a way to kind of 'filter' divs depending on the parameters supplied by a form. I have three select boxes that set 'area', 'level', and 'time' parameters (for courses). I have given corresponding classes to some example divs, and I want the ones that match the parameters to be visible, and the rest to be hidden. Here is what I have got, but it doesn't work (they all stay no matter what parameters are supplied). Any help would be greatly appreciated! html head script src=http://code.jquery.com/jquery-latest.js;/script script type=text/javascript $(document).ready(function(){ $(.coursecontent).hide(); var area = $(document).getUrlParam(area); var level = $(document).getUrlParam(level); var time = $(document).getUrlParam(time); $(. + area + . + level + . + time).show(); }); /script titleJavascript 'search' demo/title /head body form pFind a Course/p pWe have something for everyone!/p div class=BoxBody select id=area name=area size=1 style=outline: none option value= selectedSelect Course area/option option value=Any/option option value=barryBarry/option option value=cantonCanton/option option value=cardiffbayCardiff Bay/option option value=cardiffcentreCardiff Centre/option option value=cowbridgeCowbridge/option option value=creigiauCreigiau/option option value=elyEly/option option value=grangetownGrangetown/option option value=gwaelodygarthGwaelod y Garth/option option value=llandafLlandaf/option option value=llanishenLlanishen/option option value=llanrumneyLlanrumney/option option value=llantwitmajorLlantwit Major/option option value=penarthPenarth/option option value=pentwynPentwyn/option option value=pontprennauPontprennau/option option value=rhiwbinaRhiwbina/option option value=roathRoath/option option value=rumneyRumney/option option value=splottSplott/option option value=st AthanSt Athan/option option value=whitchurchWhitchurch/option option value=wickWick/option /select br / select name=level size=1 style=outline: none option value= selectedSelect Course level/option option value=Any/option option value=prePre-entry/Taster/option option value=entryEntry/option option value=wlpanEntry amp; Foundation (Wlpan)/option option value=foundationFoundation/option option value=intermediateIntermediate/option option value=higherHigher/option option value=proficiencyProficiency/Fine-Tuning/ option /select br / select name=time size=1 style=outline: none option value= selectedSelect Course time/option option value=Any/option option value=morningMorning/option option value=lunchLunchtime/option option value=afternoonAfternoon/option option value=eveningEvening/option /select br / input id=button type=submit value=Search style=outline: none /div /form div class=coursecontent barry entry
[jQuery] anonymous function and code reusing
Hi guys, apologize for posting again the same topic. I haven't found a solution yet for my simple problem. I have a simple function that works when a link is clicked $(document).ready(function(){ $(#moon).click(function(){ alert(do something); }); }); I need to reuse that function passing a parameter so I modified the function like that $(document).ready(function(){ $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); function myFunction(param){ alert(param); } }); I thought it should have worked but it doesn't. In fact, when the page has loaded even without clicking the first and second istructions are executed: $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); whereas with the following case $(#moon).click(function(){ alert(do something); }); the function need to be activate by a click any idea? Thanks a lot c
[jQuery] Hide/show divs based on form parameters
Hi all, I'm trying to selectively hide and show divs based on what a user specifies using three select boxes in a form. I'm quite new to jQuery so I'm probably missing something obvious, but here's what I've got and it doesn't, work, they divs just stay hidden. Any help would be greatly appreciated! html head script src=http://code.jquery.com/jquery-latest.js;/script script type=text/javascript $(document).ready(function(){ $(.coursecontent).hide(); var area = $(document).getUrlParam(area); var level = $(document).getUrlParam(level); var time = $(document).getUrlParam(time); $(. + area + . + level + . + time).show(); }); /script titleJavascript 'search' demo/title /head body form pFind a Course/p pWe have something for everyone!/p div class=BoxBody select id=area name=area size=1 style=outline: none option value= selectedSelect Course area/option option value=Any/option option value=barryBarry/option option value=cantonCanton/option option value=cardiffbayCardiff Bay/option option value=cardiffcentreCardiff Centre/option option value=cowbridgeCowbridge/option option value=creigiauCreigiau/option option value=elyEly/option option value=grangetownGrangetown/option option value=gwaelodygarthGwaelod y Garth/option option value=llandafLlandaf/option option value=llanishenLlanishen/option option value=llanrumneyLlanrumney/option option value=llantwitmajorLlantwit Major/option option value=penarthPenarth/option option value=pentwynPentwyn/option option value=pontprennauPontprennau/option option value=rhiwbinaRhiwbina/option option value=roathRoath/option option value=rumneyRumney/option option value=splottSplott/option option value=st AthanSt Athan/option option value=whitchurchWhitchurch/option option value=wickWick/option /select br / select name=level size=1 style=outline: none option value= selectedSelect Course level/option option value=Any/option option value=prePre-entry/Taster/option option value=entryEntry/option option value=wlpanEntry amp; Foundation (Wlpan)/option option value=foundationFoundation/option option value=intermediateIntermediate/option option value=higherHigher/option option value=proficiencyProficiency/Fine-Tuning/ option /select br / select name=time size=1 style=outline: none option value= selectedSelect Course time/option option value=Any/option option value=morningMorning/option option value=lunchLunchtime/option option value=afternoonAfternoon/option option value=eveningEvening/option /select br / input id=button type=submit value=Search style=outline: none /div /form div class=coursecontent barry entry morning Barry, Entry, Morning /div div class=coursecontent canton entry evening Canton, Entry,
[jQuery] Fuction call works in Safari but not in FF 3.5
Hi, I am having a small problem that my jquery function does work in Safari but does not work in FF 3.5. I am not sure whether the problem is with my coding skills, the jquery plugin that i use, jquery or even FF 3.5 . If i run the code below then firebug gives this error: $(.dynamicsparkline).sparkline is not a function however, the code in safari works flawlessly. The expected result are two images from Flickr and one sparkline, but the result in FF 3.5 are two pictures and the text 'Loading...' Your suggestions / help is much appreciated. best regards, Diederik html xmlns=http://www.w3.org/1999/xhtml; head script type=text/javascript src=jquery-1.3.2.min.js/script script language=JavaScript type=text/javascript $(document).ready(function() { $.getScript(jquery.sparkline.min.js, function(){ $(body).append(span class=\dynamicsparkline\Loading..\/ spanbr); var myvalues = [10,8,5,7,4,4,1,64,3,3,6,2,55,35,15,6,16]; $(.dynamicsparkline).sparkline(myvalues); }); $.getJSON(http://api.flickr.com/services/feeds/photos_public.gne? tags=cloudtagmode=anyformat=jsonjsoncallback=?, function(data){ $.each(data.items, function(i,item){ $(img/).attr(src, item.media.m).appendTo(#images); if ( i == 1 ) return false; }); }); }); /script titleTest Sparkline Page/title /head body div id=images/div /body /html
[jQuery] Validation callback for a single DIV validation
Hi all I have to perform validation on a single DIV without a submit. Also I need to catch the validation success or failure to handle them. In all validation plugin examples I've found code like: submitHandler: function(form) { alert('valid'); }, invalidHandler: function(form, validator) { alert('invalid'); } this is not working for me, since i'm not performing a submit, I'm just binding to the click event of a button. Someone can help me out? Thanks
[jQuery] Cross-site ajax file uploading
I'm using http://valums.com/ajax-upload/ plugin to upload a file to another domain It works fine, but i cannot get domain's response. Plugin makes an hidden iframe with entered data, and submit it. I get response from domain, but cannot parse it due to 'security reasons' All i want is to get link to uploaded file, its stored on iframe, i see it, but dont know how can i get it. I have tried to: $('iframe#ValumsAjaxUpload0').contents().find(body).hide(); or $('body', 'iframe#ValumsAjaxUpload0').hide(); But got JS error: Permission denied to get property HTMLDocument.nodeType in Firebug
[jQuery] Working with cross-domain iframe
I'm using http://valums.com/ajax-upload/ plugin to upload a file to another domain It works fine, but i cannot parse domain's response. Plugin makes a hidden iframe with entered data, and submit it. I get response from site, but cannot parse it due to 'security reasons' All i want is to get link to uploaded file. Its stored on iframe, i see it, but dont know how can i get it.
[jQuery] Re: Dialog position : relative
Try something like this (not perfect in all modes with all all borders and paddings, but close enough in many cases) var i = $(#myId); var top = 0; var left =0; var x=0; //x is just for avoiding infinite loops var oParent = i[0]; while (oParent x++ 10) { top += oParent.offsetTop - oParent.scrollTop; left += oParent.offsetLeft - oParent.scrollLeft; oParent = oParent.offsetParent; } top += i.height(); // want it below the i-object left -= 150; // default width is 300, so approx center var d=\$(#$theid).dialog({ bgiframe: true}); d.dialog('option', 'position', [left, top ] ); // reposistion in case of scroll d.dialog(open); On May 2, 8:32 am, led l.r@sapo.pt wrote: How can i set the position of dialog relatively to element( as a tooltip)? On May 2, 8:32 am, led l.r@sapo.pt wrote: How can i set the position of dialog relatively to element( as a tooltip)?
[jQuery] Re: anonymous function and code reusing
I thought it should have worked but it doesn't You cannot pass params like that in a click event instead of $(document).ready(function(){ $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); function myFunction(param){ alert(param); } }); use $(document).ready(function(){ $(#moon).click(function() { myFunction(param); }); $(#earth).click(function() { myFunction(param2); }); }); function myFunction(param){ alert(param); } On Jun 13, 12:07 pm, Mirko Galassi mirko.gala...@ymail.com wrote: Hi guys, apologize for posting again the same topic. I haven't found a solution yet for my simple problem. I have a simple function that works when a link is clicked $(document).ready(function(){ $(#moon).click(function(){ alert(do something); }); }); I need to reuse that function passing a parameter so I modified the function like that $(document).ready(function(){ $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); function myFunction(param){ alert(param); } }); I thought it should have worked but it doesn't. In fact, when the page has loaded even without clicking the first and second istructions are executed: $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); whereas with the following case $(#moon).click(function(){ alert(do something); }); the function need to be activate by a click any idea? Thanks a lot c
[jQuery] Autocomplete - Holding down key
Hi there I have implemented the very nice autocomplete plugin. Had to fight a couple of hours though because the thing just wouldn't show anything when I used an external data source. Finally I found out by placing some alert boxes around in the jQuery code that my page for some reason returned a 405 error. Sigh! Anyway - Isn't it possible to make the autocompletion plugin support at key being held down? Right now I have to release and push the down arrow to move the cursor which is kind of impractical. Cheers, Rune
[jQuery] Re: Trouble constructing selector string.
Maybe $(this).attr('class') != 'Value' ? I wouldn't bother using $(this).attr('class') anyway. Instead, try this.className And make sure that the class is, in fact, Value. --Karl Karl Swedberg www.englishrules.com www.learningjquery.com On Jun 12, 2009, at 9:22 AM, rinse_my_phonebook wrote: var t = 'input.ffControl[value=Add a Value]:first'; var s = 'input.ffControl[value=Add a '+$(this).attr('class') +']:first'; if(s == t) { alert(s); } $(t,this).val('gotcha'); Hi there, Can anyone help me understand why changing the fourth line of the above snippet to $(s, this).val('gotcha') does not have the effect that the orignal line has when the alert on line 3 always shows? Many thanks in advance for any effort, I appreciate it, Rinse
[jQuery] Re: anonymous function and code reusing
it is very fun! why? 2009/6/14 MorningZ morni...@gmail.com I thought it should have worked but it doesn't You cannot pass params like that in a click event instead of $(document).ready(function(){ $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); function myFunction(param){ alert(param); } }); use $(document).ready(function(){ $(#moon).click(function() { myFunction(param); }); $(#earth).click(function() { myFunction(param2); }); }); function myFunction(param){ alert(param); } On Jun 13, 12:07 pm, Mirko Galassi mirko.gala...@ymail.com wrote: Hi guys, apologize for posting again the same topic. I haven't found a solution yet for my simple problem. I have a simple function that works when a link is clicked $(document).ready(function(){ $(#moon).click(function(){ alert(do something); }); }); I need to reuse that function passing a parameter so I modified the function like that $(document).ready(function(){ $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); function myFunction(param){ alert(param); } }); I thought it should have worked but it doesn't. In fact, when the page has loaded even without clicking the first and second istructions are executed: $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); whereas with the following case $(#moon).click(function(){ alert(do something); }); the function need to be activate by a click any idea? Thanks a lot c
[jQuery] Re: Hide/show divs based on form parameters
http://www.mathias-bank.de/2006/10/28/jquery-plugin-geturlparam/ On Jun 13, 8:37 pm, Mark markjtur...@gmail.com wrote: Hi all, I'm trying to selectively hide and show divs based on what a user specifies using three select boxes in a form. I'm quite new to jQuery so I'm probably missing something obvious, but here's what I've got and it doesn't, work, they divs just stay hidden. Any help would be greatly appreciated! html head script src=http://code.jquery.com/jquery-latest.js;/script script type=text/javascript $(document).ready(function(){ $(.coursecontent).hide(); var area = $(document).getUrlParam(area); var level = $(document).getUrlParam(level); var time = $(document).getUrlParam(time); $(. + area + . + level + . + time).show(); }); /script titleJavascript 'search' demo/title /head body form pFind a Course/p pWe have something for everyone!/p div class=BoxBody select id=area name=area size=1 style=outline: none option value= selectedSelect Course area/option option value=Any/option option value=barryBarry/option option value=cantonCanton/option option value=cardiffbayCardiff Bay/option option value=cardiffcentreCardiff Centre/option option value=cowbridgeCowbridge/option option value=creigiauCreigiau/option option value=elyEly/option option value=grangetownGrangetown/option option value=gwaelodygarthGwaelod y Garth/option option value=llandafLlandaf/option option value=llanishenLlanishen/option option value=llanrumneyLlanrumney/option option value=llantwitmajorLlantwit Major/option option value=penarthPenarth/option option value=pentwynPentwyn/option option value=pontprennauPontprennau/option option value=rhiwbinaRhiwbina/option option value=roathRoath/option option value=rumneyRumney/option option value=splottSplott/option option value=st AthanSt Athan/option option value=whitchurchWhitchurch/option option value=wickWick/option /select br / select name=level size=1 style=outline: none option value= selectedSelect Course level/option option value=Any/option option value=prePre-entry/Taster/option option value=entryEntry/option option value=wlpanEntry amp; Foundation (Wlpan)/option option value=foundationFoundation/option option value=intermediateIntermediate/option option value=higherHigher/option option value=proficiencyProficiency/Fine-Tuning/ option /select br / select name=time size=1 style=outline: none option value= selectedSelect Course time/option option value=Any/option option value=morningMorning/option option value=lunchLunchtime/option option value=afternoonAfternoon/option option value=eveningEvening/option /select br / input id=button type=submit value=Search style=outline: none /div /form div
[jQuery] Re: anonymous function and code reusing
What is that reply supposed to mean? On Jun 13, 9:48 pm, John Bill hexudon...@gmail.com wrote: it is very fun! why? 2009/6/14 MorningZ morni...@gmail.com I thought it should have worked but it doesn't You cannot pass params like that in a click event instead of $(document).ready(function(){ $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); function myFunction(param){ alert(param); } }); use $(document).ready(function(){ $(#moon).click(function() { myFunction(param); }); $(#earth).click(function() { myFunction(param2); }); }); function myFunction(param){ alert(param); } On Jun 13, 12:07 pm, Mirko Galassi mirko.gala...@ymail.com wrote: Hi guys, apologize for posting again the same topic. I haven't found a solution yet for my simple problem. I have a simple function that works when a link is clicked $(document).ready(function(){ $(#moon).click(function(){ alert(do something); }); }); I need to reuse that function passing a parameter so I modified the function like that $(document).ready(function(){ $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); function myFunction(param){ alert(param); } }); I thought it should have worked but it doesn't. In fact, when the page has loaded even without clicking the first and second istructions are executed: $(#moon).click(myFunction(param)); $(#earth).click(myFunction(param2)); whereas with the following case $(#moon).click(function(){ alert(do something); }); the function need to be activate by a click any idea? Thanks a lot c
[jQuery] Re: Regular Expressions and jQuery
I think you're looking for a test() method instead! match() is used to extract substrings from a given string. function validate_phone(value,alerttxt){ var re = /^\(\d{3}\)\d{3}-\d{4}$/; var ok = re.test($(input[name=unitContactPhoneNumber]).fieldValue ()); alert(re + \n + (ok ? match : alerttxt)); return ok; } btw, the value param isn't used anywhere... just in case you have overlooked it ;-) On Jun 12, 3:57 pm, John jmcl...@birchrunsoccer.org wrote: Good call. Here are my changes. function validate_phone(value,alerttxt){ var re = /^\(\d{3}\)\d{3}-\d{4}$/; alert(re); if( $('input[name=unitContactPhoneNumber]').fieldValue().match(/^\(\d {3}\)\d{3}-\d{4}$/) ){ alert('match'); return true; } else{ alert(alerttxt); return false; } } But when I check, the alert(re) fires but the other 'alerts' do not. It's like the .match() is not called. John On Jun 12, 9:48 am, Michael Lawson mjlaw...@us.ibm.com wrote: Maybe I'm reading this wrong, but the regular expression you are using looks like it returns a match on valid phone numbers? If that is the case why not return true when it matches, false when it doesn't. Ir just put a ! in front of the match function cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: John jmcl...@birchrunsoccer.org To: jQuery (English) jquery-en@googlegroups.com Date: 06/12/2009 09:38 AM Subject: [jQuery] Regular Expressions and jQuery Hello all, I have some experience in Regular Expressions but this one has me pulling my hair out. I have a form with several input fields including a phone number field. I have a submit button that is linked to jquery form plugin. My validation is checked on beforeSubmit. ( i.e. beforeSubmit: validateForm ) I've used validateForm() for other simple validation via javascript. This time I'm using jQuery Form which shouldn't be and isn't a problem. My issue is in the validation of phone number. Within validateForm is this... function validateForm(formData, jqForm, options) { var queryString = $.param(formData); alert(queryString); // VALIDATE ENTIRE FORM //phone if (validate_phone($('input [name=piResults]').fieldValue(), Please enter a valid phone number.) == false){ phoneNum.focus(); return false; } } // VALIDATE PHONE NUMBER function validate_phone(value,alerttxt){ var re = /^\(\d{3}\)\d{3}-\d{4}$/; if( value.match(/^\(\d{3}\)\d{3}-\d{4}$/) ){ return false; } else{ return true; } } When validate_phone is called, the parameter value is correct. The problem is the match is not checked. Is there another way? Thanks for any help. J Mcleod graycol.gif 1KViewDownload ecblank.gif 1KViewDownload
[jQuery] Re: Regular Expressions and jQuery
PS. the correct phone number for your regex is, for example: (123) 456-7890 right? On Jun 12, 3:57 pm, John jmcl...@birchrunsoccer.org wrote: Good call. Here are my changes. function validate_phone(value,alerttxt){ var re = /^\(\d{3}\)\d{3}-\d{4}$/; alert(re); if( $('input[name=unitContactPhoneNumber]').fieldValue().match(/^\(\d {3}\)\d{3}-\d{4}$/) ){ alert('match'); return true; } else{ alert(alerttxt); return false; } } But when I check, the alert(re) fires but the other 'alerts' do not. It's like the .match() is not called. John On Jun 12, 9:48 am, Michael Lawson mjlaw...@us.ibm.com wrote: Maybe I'm reading this wrong, but the regular expression you are using looks like it returns a match on valid phone numbers? If that is the case why not return true when it matches, false when it doesn't. Ir just put a ! in front of the match function cheers Michael Lawson Development Lead, Global Solutions, ibm.com Phone: 1-276-206-8393 E-mail: mjlaw...@us.ibm.com 'Examine my teachings critically, as a gold assayer would test gold. If you find they make sense, conform to your experience, and don't harm yourself or others, only then should you accept them.' From: John jmcl...@birchrunsoccer.org To: jQuery (English) jquery-en@googlegroups.com Date: 06/12/2009 09:38 AM Subject: [jQuery] Regular Expressions and jQuery Hello all, I have some experience in Regular Expressions but this one has me pulling my hair out. I have a form with several input fields including a phone number field. I have a submit button that is linked to jquery form plugin. My validation is checked on beforeSubmit. ( i.e. beforeSubmit: validateForm ) I've used validateForm() for other simple validation via javascript. This time I'm using jQuery Form which shouldn't be and isn't a problem. My issue is in the validation of phone number. Within validateForm is this... function validateForm(formData, jqForm, options) { var queryString = $.param(formData); alert(queryString); // VALIDATE ENTIRE FORM //phone if (validate_phone($('input [name=piResults]').fieldValue(), Please enter a valid phone number.) == false){ phoneNum.focus(); return false; } } // VALIDATE PHONE NUMBER function validate_phone(value,alerttxt){ var re = /^\(\d{3}\)\d{3}-\d{4}$/; if( value.match(/^\(\d{3}\)\d{3}-\d{4}$/) ){ return false; } else{ return true; } } When validate_phone is called, the parameter value is correct. The problem is the match is not checked. Is there another way? Thanks for any help. J Mcleod graycol.gif 1KViewDownload ecblank.gif 1KViewDownload
[jQuery] DivMenu
there are several reasons this isn't working , the main reason is everything you click on is in the body,including the div you want to stay open. Events bubble up from children to parent. Even though you think you are only clicking on your div, you are also clicking body. Try this in firebug on any page that has jquery loaded $('*').click(function(){ alert(this.tagName); }); you can see the bubbling up of all tag's parents all the way to html tag as alerts will keep going off for each parent you will need a filter on your body click to stop your div closing something like: $('body').click(function(event){ if ($(event.target).is(.menu-cnts *)) { ///do nothing } else{ $('#' + divDados).hide();} }); that will stop your div closing, as for the rest of your method there are other issues there too: $(element).click(function(){ //why use an a tag? $('#' + divDados).hide();/// why hide the div you want to open? $(this).next().show(); // you created methods to identify your div by ID, but this is opening it ...your div is the next inline element to the atag // return false; }); I think you are trying to use this to open another div from another link but it sure seems you will have a much easier time using other methods than working with ID's you could add/remove classes such as class=hidden and css .hidden{ display:none} or something like: find(yourDivClass:visible).hide();// if you only intend to have one open at a time this would be easier than ID's you might consider scrapping out all the css parameters, work outside the plugin with real classes and ID's in your functions to get them working first then put them into the plugin after you know your methods work http://jsbin.com/ekaqe First click Euro (€), then a div shows up, the first problem is that if you click on the div, the div closes itself, and the other problem is, if you have 2 links to open divs they don't close itself, i need to click on the document page to close them Here is the JS: jQuery.fn.DivMenu = function(opcoes){ /** * Valores de defeito. **/ var variaveis = { 'display' : 'none', 'position': 'absolute', 'background' : '#fff', 'border' : '1px solid #cecece', 'font-family' : 'Verdana, Arial, Helvetica, sans-serif', 'font-size' : '11px; padding: 5px; z-index: 99' }; var opcoes = $.extend({}, variaveis, opcoes); /** end **/ /** * **/ return this.each(function(){ /** * Declarar variaveis. **/ var element = this; var offset = $(element).offset(); var left = offset.left; var top = offset.top; var currentId = $(this).attr('id'); var divDados = currentId + '-dados'; /** end **/ /** * **/ $(element).click(function(){ $('#' + divDados).hide(); $(this).next ().show(); return false; }); $(document.body).click(function(){ $('#' + divDados).hide(); }); /** end **/ /** * **/ $('#' + divDados).css({ 'left': left + 'px', 'top' : top + 15 + 'px', 'display' : opcoes['display'], 'position': opcoes['position'], 'background' : opcoes['background'], 'border' : opcoes['border'], 'font-family' : opcoes['font-family'], 'font-size' : opcoes['font_size'] }); /** end **/ }); /** end **/ }; On 13 Jun, 14:42, Charlie charlie...@gmail.com wrote: get better response with a link to see the problem, jsbin works great , has built in script libraries including jquery Glazz wrote:nobody can help me out?
[jQuery] Re: remove question
Nice trick. On 6月13日, 上午9時36分, brian bally.z...@gmail.com wrote: On Fri, Jun 12, 2009 at 2:37 PM, amuhlouamysch...@gmail.com wrote: putting it all together, you'd get something like: $('#div1').replaceWith($('#div2')).remove(); first you find div1, then replace it with div2, then remove div1 There's no need for remove() because it will have been replaced already.