Newbie help needed! IE/Firefox differences [SOLVED]
Hi all. I've just started using jQuery. The first thing I've tried experimenting with is a wee bit of code that pulls the alt attribute value out of a certain class of image, wraps the image in a div, sets the div width to match the image and appends the alt text inside the div. I've got the following so far: <img src="test.jpg" alt="My Caption" class="caption" /> $(document).ready(function(){ $("img.caption").each(function(i) { var imgwidth
[jQuery] reset toggle
I've currently got a list where each list element fades in a corresponding div when clicked. It's set to toggle so that it will fade out the same div when clicked again. I've set it up to also hide all divs so that they don't overlap each other. my code is below...my question is, is there a more efficient way to achieve the same thing? $('a.question1').toggle(function(){ $('div.answer1, div.answer2, div.answer3, div.answer4, div.answer5, div.answer6').fadeOut(); var answers
[jQuery] Concatenation
I would like to know if there is a function (or any other way) in JQuery (or a plugin) that would allow to create a concatenation of a collection of String. What I would like is to take a list or array of strings (text) and create something like a comma separated value string with it. Thanks for your help Llaurick.
[jQuery] Making jQuery turn up on time (document.ready and firing too early)
Many of us know here that making jQuery run on the right time has been a bit of a hassle in the past, mainly due to how document.ready is interpreted differently, and sometimes jQuery can fire when the DOM isn't complete - so , all that nice jquery code you have will not be able to work correctly. It looks like this problem has existed for a long time ( discussion about this same thing in 2006: http://groups.google.com/group/jquery-en/browse_thread/thread/fbf619d536e87721/cdeeab2799895486?lnk=gst&q=document.ready#cdeeab2799895486
[jQuery] Bug in jQuery selector or am I just not understanding?
Why does the code below show the values for the two alerts to be: bilbo and layout_1 ? I would have expected: bilbo and bilbo. I thought the cascading selectors would have chosen the dp_properties class that is the first child level of the selected div. . .not the dp_properties class buried two levels down (but appearing first in the DOM listing). I would have thought that I would have had to use more selectors to get into there specifically? This really breaks my thinking of how jQuery works. Do
[jQuery] Autofocus to next textbox
I know this has been discussed in the list but I can't seem to get the solutions to work. When the user has typed in 1 character to a textbox I want the focus to move to the next textbox. As I understand it, the textboxes are not siblings or consecutive elements in the Dom (because each textbox is enclosed in a table cell). The following did not work! $(document).ready(function() { $('.textbox').keyup(function () { if ($(this).val().length == 1) { $(this).next().focus() } }); }); TIA
[jQuery] close clueTip by selecting element in clueTip box
i am using clueTip with ajax to grab a list from a db. i would like the clueTip to close when the user selects an item from the list. i'm guessing there is an easy way to do this, but i've tried for a while now without any success. i tried calling cluetipClose() with the onclick event, but since the clueTip is a separate web page, it is saying that cluetipClose() is not defined. any ideas? thanks.
[jQuery] cluetip additional functionality
The jquery.com suggest a feature would not let me login. So I am posting it here. I added focus/blur event handling to cluetip. So it can be used in conjunction with forms or other elements that you might not want to hover or click. added to: jquery.cluetip.js =BIND EVENTS -------------------------------------- */ // activate by focus } else if (defaults.activation == 'focus') { $this.focus(function(event) { activate(event); }); $this.blur(function(event) { inactivate(event); });
[jQuery] Simple Question: Using Variables in jQuery
I'm using an id tag (based on my database id) in my html to help direct traffic. On a click I use the following which grabs the variable from the id tag of the link: var myID = $(this).attr("id"); I tested that with an alert and it works properly... Now then, if there was an unordered list with that same id later on the page that I want to load the contents of a html file how would I do it? The following was my guess but I guessed wrong... $("ul#"myID).load("data.html"); Kindest, Wil
[jQuery] jQuery.easing[this.options.easing || (jQuery.easing.swing ? "swing" : "linear")] is not a function
After upgrading to jquery 1.2.1 I'm getting the error above on a regular basis. Has anyone else seen this?
[jQuery] Form question
Hello, I'm working on a user profile page that has fields for shipping address and billing address, with a checkbox that says, "Same as shipping?" You know the kind... where instead of filling out the billing address, it autopopulates from the shipping fields you just filled out. What would be the simplest way to do this? That is, to grab the values from the shipping fields, populate the billing fields, then disable them? Thanks, Nathan
[jQuery] JQuery Tabs not loading on first click
Tabs are not loading on the first click. I have a link which is like: <li class="news"><a href="javascript:loadTabs('news')">Headlines</a></ li> when user clicks on this it calls the following function: <script> function loadTabs(filename) { $('head').append('<link type="text/css" href="'+ webroot + 'css/ ui.tabs.css" rel="stylesheet" />'); $.getScript(webroot + "script/ui.tabs.js"); $.get(webroot + "html/"+filename+".htm", function(data){ $("#cbody").html(""+data+""); $("#newscontainer
[jQuery] jQuery minified size could be wrong?
jQuery page allows us to download jQuery minified and Gzipped with 14.1kb using this link: <a href="http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.min.js">http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.min.js </a> But after download it that plugin haves 46kb. John, what's wrong? Cheers Marco Antonio
[jQuery] textarea cursor position
Hello, I'm looking for a snippet of code or a plugin that will give me the current position of the cursor within a textarea. Does anyone have one that they can share?
[jQuery] document.getElementById('elid') != $('#elid') ?
I was trying to populate a select's options when I noticed that I can use: sel = document.getElementById('product_id_01'); sel.options.length = 0; but I can't use: sel = $('#product_id_01'); sel.options.length = 0; If anyone could provide a short explanation I'd be really grateful. Thank you.
[jQuery] IE Help.
Are there any ie hacks or maybe some ie tricks with jquery? Ie's being stubborn with me and whenever i try to make a simple slider click x { show y } type of thing it doesn't even work. Does anyone else have trouble with IE and Jquery?
[jQuery] Problem with jquery toggler conflicting with another jquery script
Hello, I must be up front and say that I know very little about JS. I only know enough to basically implement it and follow instructions and sometimes diagnose problems, but this time not being one of them. This is an issue of a jquery toggler not working in IE6 vs FF.I have a few other jquery scripts on the site as well, one for smooth scroll and one for lightbox. On my site www.robertngordon.com/web if you scroll down to the description of the projects (under the large picture) you will see a 'read
[jQuery] fadeIn/Out problem
Hi to all, i'm having problems with fade in/out animation. I have buttons and i want to make hover fade-in effect. this is html: <div class="button"> <div class="button-base"></div> <div class="button-hover"></div> <a href="#">Top rated</a> </div> <div class="button"> <div class="button-base"></div> <div class="button-hover"></div> <a href="#">Groups</a> </div> at the beginning button-hover is hidden, and i want to make it fade-in when button is hovered, this is script i use:
[jQuery] does jquery 1.2.1 support xpath????
I find something strange in last release. Xpath expressions doesn't work For example var test1 = $('/html/body'); alert(test1.length); always print 0
[jQuery] == onload function with the fadeIn effect. How? ==
== Desired result: I want a html file to be loaded into a div element. When the file is injected, I want it to fade in. == Problem: I am a rookie when it comes to jQ (and js). I can't figure out how to extend the onload function with the fadeIn effect. == This is my jQ code: $(document).ready(function() { $("p a") . click(function() { $("#text-to-show") . load("text_to_show.htm"); }); }); == Thanx
[jQuery] :contains selector question
Hey guys, Wanted to make sure I am getting the correct returned elements. Assume I have a table like: <table cellpadding="3" cellspacing="0" border="1" width="100%"> <tbody> <tr> <td>Cell 1</td> <td>Cell 2</td> <td>Cell 3</td> <td>Cell 4</td> <td></td> <td>Cell 6</td> </tr> </tbody> </table> And then I run a
[jQuery] AJAX memory leak
Hi, Had some trouble with leaking memory and finally found out that it is not my fault but jQuerie's. The testscript is quite simple: for (var i=1; i<=100; i++) $("#testarea").load("testload.php"); The memory grows about 6MB everytime I press F5. I only get the memory back by closing the browser. Using latest SVN 1.2.1, IE 7, FF 2.0.0.9 Eric
[jQuery] jQuery Form Plugin > document.myform.submit()
I love the jQuery Form Plugin! I want to submit the form using an onClick event instead of making the User click a <input type=submit> button. Is that possible? I tried the below but no luck: function submitme(){$('#myform').submit(function() { $(this).ajaxSubmit(); return false; });} <a href='#' onClick="Javascript:submitme();">Click here to submit myform.</a>
[jQuery] [jquery-ui] sortable problem ...
I have problems getting some of the the callback functions to work. 'stop' and 'update' refuse to work for me. here's some example code i'm using: <ul id="List"> <li>Item 1</li> <li>Item 2</li> <li>Item 3</li> <li>Item 4</li> <li>Item 5</li> </ul> $j('#List').sortable({ start:function () { console.log('startdrag'); // traces }, sort: function () { console.log('sorting'); // traces }, update:function () { console.log('sth changed ...');
[jQuery] Event Handler behavior question
Hi, This probably is closer to just being a plain Javascript question, but since I'm using jquery to wrap it, I figured I'd ask it here. I'm using the hover( fn,fn1) function to bind the hover event to my table's TR elements upon page, load by using ready(). The HTML itself actually specifies a css class, statically, for each TR: "activeRow", and I'm using ( not valid code ): $(".activeRow").hover ( function(), function() etc... ( the activeRow css class has a different background than my "inActiveRow"
[jQuery] LiveQuery (Discuss Please)
So as far as I'm concerned, livequery is the biggest advance in jQuery since its inception (no, I am not its author). I'm trying to understand why it's having such a slow rate of adoption.<div> </div><div>it solves this problem: </div><div>$("div.klass").draggable();</div><div>$("#foo").load("url", function() { $("div.klass").draggable(); });</div><div> </div><div>beautifully, as you now only need to do: </div><div> </div><div>$("div.klass").livequery(function() { $(this).draggable() });</div><div>$("#foo").load("url");</div><div>
[jQuery] Styling left hand column of table.
Hi, I've just read the Jquery book and though I understood a bit about selectors, turned out I was wrong! I am trying style every cell in a table but style the left and right most colums differently. I start with three classes.... GridLeftCell GridMiddleCell GridRightCell ... and I style every cell with "GridCellMiddle" I then try to replace the class on all cells in the first column by doing the following.. $(document).ready(function(){ $(".Grid tbody td").addClass("GridMiddleCell"); $(".Grid tbody
[jQuery] Bound Text Box
Hello, Is there a plug-in that I could just specify the table name and field name and when the user updates it, it automatically saves into the database? Are there any samples that do that? I suppose the catch is that you need to create a record if the recordID of the collection of fields is zero. Right? Darcy
[jQuery] Beginner: FF not setting correct width?
Hi all. I've just started using jQuery a couple of days ago. The first thing I've tried experimenting with is a wee bit of code that pulls the alt attribute value out of a certain class of image, wraps the image in a div, sets the div width to match the image and appends the alt text inside the div. I've got the following so far: $(document).ready(function(){ $("img.caption").each(function(i) { var imgwidth = $(this).width(); var captiontext = $(this).attr("alt")
[jQuery] Jquery 1.2.1 > AJAX > load.() > newbie question
When I click the "submit" button it should do AJAX and put the contents of the insertme.html file in the id "feeds" but it's not working. I must be missing something really basic... <html><head> <script src="jquery-1.2.1.min.js"></script> <script> function loadme(){alert("Hi, I'm running!"); $ ('#feeds').load('insertme.html');} </script> </head> <body> <ul id="feeds"></ul> <form> <input name="stuff" type="text"> <input type="submit" value="Go" onClick="Javascript:loadme();"> </form> </body> </html>
[jQuery] problem with $(String expr, JQuery context)
If I use this script: var str = "<h1>xToDo - Gestire progetti con AJAX</h1>Attualmente ci sono <b></b> progetti e <b></b> task inseriti nell'applicazione.<br/
[jQuery] jQuery functions on loaded html
Test: <a href="http://wil1.com/jtest/index.html">http://wil1.com/jtest/index.html</a> Source: <a href="http://wil1.com/jtest/wil.js">http://wil1.com/jtest/wil.js</a> Description: When you click on an arrow image the sub-listings are loaded via a plain html file (eventually this will load from an api call), the image is changed, the list is then slideToggle'd. Problem: It seems that none of my jQuery functions work on the loaded html. Neither the hover menu onclick of the company titles and the html
[jQuery] taconite plugin with jform plugin
Hello, I'm a newbie with JQUERY and i'd like to use taconite plugin with a submit form. Could you show me a little example or where I can find it. Thanks Alaiz
[jQuery] Looking for theoretical help for news scroller.
Hi, I'm playing with jquery, and I'm tryng to do a news scroller. In my markup I have an unordered list with position relative that I move with setInterval and top position. I draw a little scheme to show you what's my problem: http://www.gianiaz.net/jquery/newsscroller/newsscroller.png There'a a technic or something else to made the illusion that the news list is infinite? Thank you
ToggleClass() is not toggling classes [SOLVED]
Hello. I am trying to change all three tab class to remove the extraneous "active" from the class name of each tab, then prepend the "active" class to a certain tab. Here is the code I tried to write, but it doesn't take the "active" off the tab_01 anchor: $(".tab_01 active").toggleClass("tab_01"); $(".tab_02 active").toggleClass("tab_02"); $(".tab_03 active").toggleClass("tab_03"); // re-assign class - this will be dynamic $(".tab_01").toggleClass("tab_01 active"); Here is the XHTML code: <div
[jQuery] Rounded corners-canvas and ie6
Hi guys, I implemented a rounded-corner-canvas into this project. I used it since its support to borders and a good anti-alias effect. But on IE6 I am having a strange issues I don't know how to solve: right and bottom right to the parent node of the rounded divs, canvases are not positioned to the 0/0 px coordinates but a pixel before, showing the border/background of the div beneath. Any idea? You can find the page at this address: http://www.bonsai-studio.net/live_preview/miniblog3/ While you
New at Jquery please help......
Im trying to make a drop menu that drop on click and return on click. the code looks like this :: $(document).ready(function(){ $("a.ic").click(function(){ $(this).parents("div.closed").removeClass("closed").addClass("open"); $(this).removeClass("ic").hide(); $(this).addClass("io").show(); return false; }); $("a.io").click(function(){ $(this).parents("div.open").removeClass("open").addClass("closed"); $(this).removeClass("io").hide() $(this).addClass("ic").show(); return false; }); XHTML's like this::
.find always returns 1 item for ids
This may be because ids are supposed to be unique -- but there is a case for me where they may not be. $('#someDiv').dosomething That only happens to the first one it finds. I thought it used to happen to all of them. Any thoughts?
[jQuery] Inserting at the caret
Hi all, Whats the best way to insert some content at the caret in a text field? Cheers, Mike
[jQuery] RE: jQuery UI Datepicker v3.0 Released! (Previously named jQuery Calendar)
<span id="thread_subject_site">@Stefan: datepicker({ firstDay: 1 }); <a href="http://docs.jquery.com/UI/Datepicker/datepicker#options">http://docs.jquery.com/UI/Datepicker/datepicker#options</a> Click the options tab here to see the 30+ customization option: @Dan: The animation snap back occurs when you have drastically different datepickers on the same page. Typically this wouldn't happen because you would only use one type of datepicker on most applications. @Graeme: Click the stylesheet tab on
Next Page