[jQuery] New to jQuery and JavaScript
Hello Group, Does anybody know which plugin in jQuery to use when dealing with forms with dependencies? What I mean is that a second and third input elements are dependent on the first input selection. The second and third elements would probably disabled or hidden first and will only be activated when the first input selection is done. I want to implement this using AJAX using data from the database (MySQL). Any tip is highly appreciated. Thanks. jquery_newbee
[jQuery] New to JQuery
Hello All, I am new here and I would need your support in order to get started. Where can I get tutorials and wikibooks on JQuery? Also recommend books. Regards, Emeka
[jQuery] New to jquery, multiple .js files not running
I am very new to JQuery and to scripting in general so bear with me, this might be a very easy fix and I dont know it. I believe what Im trying to do is about as simple as jquery gets... Im building a simple portfolio site for myself and I am trying to use the .hide() and .show() methods to hide and show the various sections and subsections. I have one file panels.js which is working fine on its own to hide and show the main sections. But a second file gallery.js, which is supposed to control the subsections, never gets read. I can see the contents of the file in firebug, but nothing inside gets executed. If I take the contents of gallery.js and try to place them into the panels.js file. the whole thing stops working. So Im assuming its something off with the scripts in gallery.js. Heres the site so far: http://www.andrewcroce.com At this point I am only working on the "ARTWORK" section, so that is the only section that should be working, please don't bother clicking on the other sections. What should be happening is that all the entries that say "Image Title" with some lorem ipsum should all be hidden at first, and only the first sentence at the top should show, but at this point all of it just stacks up and none of it is hidden. heres the contents of gallery.js //hide all the subsections and show the intro $(".current_panel .image_area").removeClass("current_area"); $(".current_panel .image_area").hide(); $(".current_panel .intro").show(); $(".current_panel .intro").addClass("current_area"); $(".back_tab").hide(); //when a tab is clicked that section is displayed $(".tab").click(function(){ var current_section = $(this).attr("name"); $(".tab").removeClass("current_tab"); $(".current_panel .intro").hide(); $(".image_area").hide(); $("#"+current_section+"_tab").addClass("current_tab"); $("#"+current_section+"_area").addClass("current_area"); $("#"+current_section+"_area").show(); $(".back_tab").show(); $(".back_tab").click(function(){ $(".image_area").removeClass("current_area"); $(".image_area").hide(); $(".current_panel .intro").show(); $(this).hide(); return false; }); return false; }); Any pointers would be greatly appreciated. Andrew
[jQuery] new to jquery, new to google groups :O
I am trying to populate the array opid, with values that I gain access to in an each function. I have crudely tested the loop working using some alerts, the each statement is looping the elements I want. Now the problem is that I want access to the opid array after the each function as indicated below. Can anyone help? Thanks Lee var opid = new Array(); $("a.btn.submit").click(function(){ // alert($(this).attr("id").substr(7)); var userid = $(this).attr("id").substr(4); $("#"+userid+" input:disabled").each(function(i){ // var opid = new Array(); if($("#chk_"+$(this).attr("id").substr(9)).is(":checked")) { if ($("#pa_"+$(this).attr("id").substr(9)).val() == '') { //display error, alert("If you have selected to submit a PO you must give it a weighting"); var error = 1; } else { alert($(this).attr("id").substr(9)+" "+$(this).val()+" "+$("#pa_"+ $(this).attr("id").substr(9)).val()) opid[i]['opid'] = $(this).attr("id").substr(9); alert(opid[i]['opid']); } } else { // alert("not selected"); } i++ }); Need access to opid array here });
[jQuery] New to JQuery, silly question.
Why does this : $(document).ready(function(){ if($(".leftNav ul li:last").height() < 32){ $(".leftNav ul li.last").addClass("lastWithItems"); } }) work in 1.3.1 but not this $(document).ready(function(){ if($(".leftNav ul li.last").height() < 32){ $(".leftNav ul li.last").addClass("lastWithItems"); } }) (Notice the li.last on both lines) ??? Also why isnt it explained anywhere :( Another thing why cant i do this function blabla() { } $(document).ready(blabla()) ? and i have to do $(document).ready(function(){}) >From what i recall i could do both things in 1.2.6, now with 1.3.1 those seem to be impossible, also why isnt there any mention on the Jquery doc/tutorial pages? :( Thanks --- Alexandru Dinulescu Web Developer (X)HTML/CSS Specialist Expert Guarantee Certified Developer XHTML: http://www.expertrating.com/transcript.asp?transcriptid=1879053 CSS : http://www.expertrating.com/transcript.asp?transcriptid=1870619 RentACoder Profile: http://www.rentacoder.com/RentACoder/DotNet/SoftwareCoders/ShowBioInfo.aspx?lngAuthorId=6995323 MainWebsite: http://alexd.adore.ro Portofolio: http://alexd.adore.ro/project_page.php
[jQuery] New to JQuery: First Question (animating background image)
All, I just started work with jQuery just recently, and I'm beginning to love it. I'm a Prototype convert, and I love the increased power of jQuery. New to it though, I'm running into some trouble already. I'm trying to flip between different background images, with CSS set initially to the BODY tag. The goal is to produce a "slideshow" in the background of page. I cannot for the life figure of why this code isn't changing the background image of the BODY tag. I'm beginning to think it's a DOM limitation of some sort, but in case I am overlooking something, I thought I would post it here: $(document).ready(function() { $("body").animate( { backgroundImage:"url(/images/test-backgrounds/ china_chinese_chinglish_1432992_o.jpg)"}, 1000 ) .animate({opacity: 1.0}, 1000) .animate( { backgroundImage:"url(/images/test-backgrounds/ google_scifoo_camp_291462_o.jpg)"}, 1000 ) }); What I think this should be doing is setting the background, "pausing" (what I am using the opacity call for), and then changing the image. Again, any help is most welcome. Thank you very much in advance.
[jQuery] New to jquery. How to get the following component??
Hello, I am interested in the following component (as seen on the following page): http://ui.jquery.com/demos It must be some sort of flow component. Can anyone tell me where to get it from? Where it is documented? Best regards, Julien.
[jQuery] new to jQuery
Hi friends, 'm very nwe to jQuery. I started reading the book Manning jQuery I find it interesting.. So far this is the first JavaScript Library 'm ever trying so 'm pretty much impressed by the ease with which can do lot of things. I 'm not very much familiar with server side scripting. So what kinda application can I make using JUST jQuery so I can get idea about real world application. Thanks
[jQuery] New to Jquery : Using it on dynmaically created divs
Hi. At the moment I've creating 2 divs for each record in a database. One to first give a title for that piece of information and the second to be a show/hide div that gives furthur information upon clicking a little arrow. I generate both divs server side on an updatepanel refresh. I have them showing/hiding at the moment using this function... function divShowHide(divID, imgID){ // Hides/Shows the second div and changes arrow appearance var divToChange = document.getElementById(divID); if(divToChange.style.display == "block") { divToChange.style.display = "none"; document.getElementById(imgID).src = "Images/downarrow.png"; } else { divToChange.style.display = "block"; document.getElementById(imgID).src = "Images/uparrow.png"; } } I was wandering if I could incorporate Jquery into this function to make it do the job , or if all the divs have to be created in the head section with jquery beforehand?? I have tried using the show/hide commands in the above function using Jquery but they don't seem to work. Each of my second divs have a unique ID, I just need to know if it's possible to do it in this way?? All the examples on the site use pre-defined names for divs but as I do not know the ammount of div sets before so can't do that. They are all called "div2" + a unique identifyier. Any help would be greatly appreciated. Thanks, James
[jQuery] New to jQuery --> Dynamically navigating the DOM
Hi gang, I'm just coming across to jQuery and trying to figure out the best way to dynamically navigate the DOM. Where there's an element object, I'm happy with parent() and next(), but in functions that don't reference an element object, I'm a little confused. Here's some clarification: errorPlacement: function(error, element) { error.appendTo( element.parent().parent().next().next()); }); I'm happy and fine with this. However: success: function() { "want to do a similar --> 'this' works here, but 'element' is blank. this.parent()/ this.next() returns an error. Any suggestions appreciated - cheers. :-) - Jub
[jQuery] New to Jquery, have written Validation script...
Hello, I have never written a Jquery script, but have, over the last few days, compiled the following, but was hoping someone could look over this to see if I had problems. $(document).ready(function () { $("#my-form [EMAIL PROTECTED]'input']").blur(function() { var queryString = $.("#my-form").formSerialize(); $.post("/path/to/your/validation.php", queryString, function(validation_errors) { // do something like changing a css class, disable submit... $.each(validation_errors, function(err_id, err_message) { $(err_id).val() = err_message; } )}; }); )}); Thanks, Nishan
[jQuery] New to jQuery.. Seeking help with early ideas
I'm currently loading an external .html file on click. The code is: $("a#interactive").click(function () { $("#subNav").load("work_interactive.html"); }); However, I'm having difficulty trying to learn how to add effects on the content's load in. Maybe a fade in, or a drop down of the div, etc. Any help?
[jQuery] new to jquery
Hello, i've been writing javascript for a while now. So, as you can imagine I am struggling just a bit. I browsed a few of the beginner tutorials and didn't see what I was looking for. I understand that methods like .is or .hide are special to the jquery library and you can't access these using regular DOM elements. But I don't want to type $(this.parentNode.parentNode) every time I want to do something to it. Assigning var target = $(this.parentNode.parentNode); still doesn't let me use jquery methods against target. Can someone point me in the right direction here?
[jQuery] New to jquery. Things just don't work.
Hi, Am new to jquery and also not so proficient with . So bear with me if it sounds silly. I just can't get jquery to work the way its promised. I did these, 1. Downloaded jquery-1.2.js 2. Included it in my html. And wrote my first code as this ${document}.ready(function() { ${'a'}.click(function() { alert("Link clicked"); ${'#main-content'}.html(' Hello '); return false; }) }); This didnt work. I got an error that said "missing ; before statement" 3. Changed my code to replace all ${} references with jQuery(). Though this works, I get two alerts everytime i click a link. And content of div with id main-content doesn't change either. What am I doing wrong. Any help/pointer will be appreciated. Regards Sathya
[jQuery] New to JQuery with error message
Dear all: I am new to JQuery and encounted this error message just load the latest JQuery library. Following is the code: http://tana.am.lilly.com:9045/pgi/ js/jquery-1[2].2.2.pack.js"> And here is the error message: A Runtime Error has occurred. Do you wish to Debug? Line:339. Error: Object doesn't support this property or method. Any suggestion is greatly appreciated. thanks much -Jian
[jQuery] New to jQuery
My experience w/ Ajax is limited at best. I've used the Spry framework to date and its great w/ the exception of it breaking in Safari. My question is why does this framework break in Safari and if jQuery doesn't how/why is it different? Thanks in advance.
[jQuery] New to jQuery, question on accessing form elements in nested HTML documents
I have a form that lives in its own HTML file. If I load the jQuery library into the page, I can assign click handlers to buttons on the form, no problem, by putting them in the $(document).ready function like this: $(document).ready(function(){ alert('document is ready'); // just seeing if we're awake $('#btnsubmit').click(function() { alert('submit was clicked'); // we ought to see this every time return false; }); }); That page works fine standalone in a browser... However, if I load that HTML file into an ThickBox on another page, the click handlers no longer work. I see the alert message telling me that $(document).ready is called, but the code inside the click handler is not executed. Would I have to define the handlers in the outer HTML document for this to work? TIA, Jim
[jQuery] New to jquery, adding/modify option box in a block
Hi all, Given the enthusiasm of the community that surrounds jquery, in addition to the excellent documentation, I've decided to give it a go over prototype and the like. I have a rather simple inquiry that's more conceptual than technicalicaties of syntax. I'm currently writing an application for a car inventory. Users have the option to select make/model, etc, which ultimately adds the options to a database. My issue is right now I lack an existing database with car make/ models, and I'm looking to incorporate some javascript to allow users to dynamically add/modify/remove options in a block. Is JQuery the right tool for this? If so, would anyone be kind enough to point me in the right direction as far as documentation to begin reading so I can attempt an implementation? Thank you kindly all! Cheers, - sf
[jQuery] New to jquery, adding/modify option box in a block
Hi all, Given the enthusiasm of the community that surrounds jquery, in addition to the excellent documentation, I've decided to give it a go over prototype and the like. I have a rather simple inquiry that's more conceptual than technicalicaties of syntax. I'm currently writing an application for a car inventory. Users have the option to select make/model, etc, which ultimately adds the options to a database. My issue is right now I lack an existing database with car make/models, and I'm looking to incorporate some javascript to allow users to dynamically add/modify/remove options in a block. Is JQuery the right tool for this? If so, would anyone be kind enough to point me in the right direction as far as documentation to begin reading so I can attempt an implementation? Thank you kindly all! Cheers, - sf
[jQuery] New to jQuery: Problem setting current time to some element
Hi, This is my code: function displayDate(){ var date = new Date(); $("#dateandtime").text(date); } $(document).ready(function(){ setInterval('displayDate()', 1000); }); But it doesn't work, however, if I have this: $("#dateandtime").text("some text"); The content of the element with "dateandtime" id selector will change to "some text". I don't understand why it doesn't change when I have this: $("#dateandtime").text(date); I'm new to jQuery, please advise... Thanks in advance.
[jQuery] New to jQuery and struggling
I am (relatively) new to JavaScript and brand new to JS libraries. Prior to jQuery, I was using Yahoo's library, but was well-impressed with jQuery and made the move. I have a series of custom written js functions which fire-up when the DOM is ready and i am happily using jQuey's $ (document).ready(function(){}); tool in an external script kept in the head of the document. However, I am trying to add an additional $(document).ready(function() {}); in the middle of the document (i.e. inline) but it is not working and i don't know why. Are only 1 x $(document).ready(function(){}); allowed in a script? If not, any ideas what's going wrong?