[jQuery] Re: click fires twice

2009-01-29 Thread Ryura
Sounds like you've bound the event twice. Can we see the whole page? On Jan 29, 8:03 pm, brian wrote: > both jquery-1.3.1 and 1.2.6 on FF > > No beginner here, but I'm absolutely stumped. The following function > is firing twice. There are no other event handlers involved (and, > anyway, it's on

[jQuery] Re: $({key: value}) functionality?

2008-12-22 Thread Ryura
]') or $(data.x.a).filter('[name="foo2"]') This does what I require. On Dec 22, 10:05 pm, Ryura wrote: > I'm looking into ways to manipulate Javascript objects using jQuery, > and I was wondering if there's anything I can do with the selectors > when passi

[jQuery] $({key: value}) functionality?

2008-12-22 Thread Ryura
I'm looking into ways to manipulate Javascript objects using jQuery, and I was wondering if there's anything I can do with the selectors when passing an object to jQuery. For example, $({ obj1: { name: "a", prop: "x" }, obj2: { name: "b", prop: "y" }, obj3: { name: "c", prop: "z" } }).filter('[n

[jQuery] Re: Smarter way to write this repetitive code?

2008-12-22 Thread Ryura
Right - .each() is still being called internally. You'd need to bind the event to a parent element. On Dec 22, 7:24 pm, Kean wrote: > dbzz, IMO, your code still add a listener to each of the .headline > > var txt = $('.article-text'); > var $hl = $('.headline'); > > $hl.click(function(e) { >    

[jQuery] Re: Can I "access" and change content loaded dynamically after jQuery.js?

2008-12-21 Thread Ryura
Try the liveQuery plugin: http://docs.jquery.com/Plugins/livequery On Dec 21, 1:20 pm, suntrop wrote: > Sorry for that, but how can I bind the event after I call $ > ("#content").load(loadLink,"",hideLoader);? > > Do I have to replace hideLoader with a function that contains all the > "new" code

[jQuery] Re: Smarter way to write this repetitive code?

2008-12-20 Thread Ryura
$('.headline').each(function(i) { $(this).click(function() { $('.article-text:eq('+i+')').fadeIn(); }) })

[jQuery] Re: Having trouble thinking through the "how": make node, append (w/o showing), then fade in ...

2008-12-07 Thread Ryura
What about something like this? $("").hide ().appendTo("#myList").slideDown("fast"); On Dec 7, 8:10 pm, nathanziarek <[EMAIL PROTECTED]> wrote: > I'm having a hard time working through this in my mind (and a much > harder time in code.) > > I am receiving a JSON array. I am then looping through

[jQuery] Re: First steps in jQuery: trying to figure the syntax to mix standard Javascript with jQuery

2008-12-02 Thread Ryura
The glue code is converting your jQuery object. var text = $('div.selectable')[0].getSelection(); alert(text); [0] takes the first element you selected and "removes" the jQuery methods, "replacing" them with the usual DOM methods. I don't know how supported .getSelection() is so this code may no

[jQuery] Re: How do I keep from focusing a readonly field?

2008-10-28 Thread Ryura
$('tbody>tr:last-child>td:not(.readonly):first- child>input').focus().select(); On Oct 28, 7:07 pm, TimW66 <[EMAIL PROTECTED]> wrote: > Hi all, > > I have a table that I will usually want to focus the first input box > in the first column in the last row.  Something like this: > > >   >

[jQuery] Re: Quick Syntax Error Check

2008-10-28 Thread Ryura
IE hates it for good reason. Proper JSON (and Javascript object declaration) has no trailing comma on the final line. This is one thing IE does right that the other browsers are too giving on. On Oct 28, 5:57 pm, JCQ <[EMAIL PROTECTED]> wrote: > I agree with Tim, that is EXACTLY the problem.  I

[jQuery] Re: Selector

2008-10-27 Thread Ryura
evels = $('input[name="Level"]:checked + label'); Should do it for you. On Oct 27, 7:13 pm, shapper <[EMAIL PROTECTED]> wrote: > Hello, > > I have the following: > > levels = $('input:checked + label'). ... > > Can I select only the inputs checked but which name is "Level"? > > Thanks, > Miguel

[jQuery] Re: mixing jQuery with regular JavaScript

2008-10-24 Thread Ryura
Alternatively, $(function(){ window.test = function(){ console.log('hi')} }); On Oct 24, 10:11 pm, Mike Alsup <[EMAIL PROTECTED]> wrote: > > I'm trying to mix jQuery with some pre-existing JavaScript/HTML, but > > I'm having what appears to be scope issues. > > > The code I'm working

[jQuery] Re: Change Event Firing Twice

2008-10-24 Thread Ryura
Does ticking one untick another? That would trigger a change event on the one being ticked as well as the one being unticked. On Sep 22, 5:26 pm, sobencha <[EMAIL PROTECTED]> wrote: > My problem is that I seem to be having a change even firing twice. > Here are the details > > I have several

[jQuery] Re: what is difference between $(document).height() and $(window).height() ?

2008-10-21 Thread Ryura
1.2.6 http://support.zetaboards.com/index/ On Oct 21, 7:06 pm, tallvanilla <[EMAIL PROTECTED]> wrote: > @ryura: > What version of jQuery are you using? Anything after 1.2 (possibly > earlier) should return identical results for $(window).height() and $ > (document).height().

[jQuery] Re: what is difference between $(document).height() and $(window).height() ?

2008-10-21 Thread Ryura
t; No, they're exactly the same. Try it and let me know if you get > different results. > > JR > > On Oct 21, 11:25 am, Ryura <[EMAIL PROTECTED]> wrote: > > > Actually, it seems that the document's height is the entire page's > > height, while the

[jQuery] Re: what is difference between $(document).height() and $(window).height() ?

2008-10-21 Thread Ryura
Actually, it seems that the document's height is the entire page's height, while the window height is only the viewing height(ie: what you see at that given time). On Oct 21, 1:00 pm, tallvanilla <[EMAIL PROTECTED]> wrote: > Good question. No difference. Both should give you the exact same > resu

[jQuery] Re: Display a div if and id is found

2008-10-17 Thread Ryura
Actually, you don't need the > 0 part. 0 evaluates to false anyway, so just if($("#whatev").length) works fine On Oct 17, 4:09 pm, "Mauricio \(Maujor\) Samy Silva" <[EMAIL PROTECTED]> wrote: > Another approach: > if ( $('#FirstDiv').length > 0 ) { $('#SecondDiv').show(); } > -

[jQuery] Re: Trying to "capture" the html code from $('body')

2008-10-10 Thread Ryura
.html is actually a function. You need to replace all instances of .html with .html() for example: testArray = myRe.exec( $("#wrap").html ); // Collect found words in testArray Should be: testArray = myRe.exec( $("#wrap").html() ); // Collect found words intestArray On Oct 10, 4:

[jQuery] Re: Valid jQuery on Development fails on Production

2008-10-06 Thread Ryura
You have some unclosed tags (the last tr and td). Try closing those. On Oct 6, 6:06 pm, rich <[EMAIL PROTECTED]> wrote: > I am writing a fairly basic script using jQuery. However, the script > behaves differently depending on whether I am running it on my local > Web server (localhost) or on a pr

[jQuery] Re: Designing ajax applications / DOM issues

2008-09-27 Thread Ryura
You'll want to look into the Live Query plugin: http://plugins.jquery.com/project/livequery/ On Sep 27, 2:55 pm, "silk.odyssey" <[EMAIL PROTECTED]> wrote: > I am getting started with jQuery and I think I understand the basics. > I want to get into ajax and while I can communicate with the server

[jQuery] Re: missing ) after argument list error

2008-09-22 Thread Ryura
Well, what's the rest of your code? The snippet you've provided is fine, so there must be an issue with another code. On Sep 22, 6:59 pm, switch13 <[EMAIL PROTECTED]> wrote: > Can anyone tell my why this might not work in a separate .js file but > it does work from the firebug debugger? > > On Se

[jQuery] Re: Can I use a variable to reference object properties?

2008-09-11 Thread Ryura
var myCategory = "cheese"; $.each(data[myCategory], function(i, item) { do a ton of stuff }

[jQuery] Re: Please examine my code or tell me why it may not be working.

2008-09-04 Thread Ryura
Looks like you never included the actual jQuery file, only the plugin. On Sep 4, 9:21 pm, Ray <[EMAIL PROTECTED]> wrote: > I downloaded the jquery cycle plugin fromhttp://malsup.com/jquery/cycle/ > and renamed it jquerycycle.js. I made minor changes to the images but > kept everything else pretty

[jQuery] Re: Changing $ to other symbol

2008-08-19 Thread Ryura
You'll want to look at jQuery.noConflict(); http://docs.jquery.com/Core/jQuery.noConflict On Aug 19, 11:33 am, jbetts80 <[EMAIL PROTECTED]> wrote: > Good Morning, I am developing an application that use $ symbol. I have > tried to implement jQuery in my app and there are conflicts because > jQuer

[jQuery] Re: how to insert javascript code instead of text with .before() or anything else jQuery has?

2008-08-19 Thread Ryura
That should've worked. Can you provide a test-case page? On Aug 19, 12:02 am, Cormac <[EMAIL PROTECTED]> wrote: > Could you please tell me how to do it properly? I tried writing "<\/ > script>", but it didn't work. > > Thanks! > > On Aug 19, 4:3

[jQuery] Re: An easy question: Selecting DOM nodes that doesn't have class "active"

2008-08-19 Thread Ryura
Also, .hide() does the same as setting the CSS to display:none. On Aug 19, 10:24 am, Karl Swedberg <[EMAIL PROTECTED]> wrote: > On Aug 19, 2008, at 8:09 AM, Giovanni Battista Lenoci wrote: > > > > > > > Hi, I have this code: > > > > > > >   > >  ... > > > > > >   > >  ... > > > > > >   > >

[jQuery] Re: Question about variable declaration

2008-08-19 Thread Ryura
The problem here is that neither of your expressions can EVER evaluate to false. Even if no actual DOM element is selected, you still get an empty (jQuery)array. On Aug 19, 4:34 am, andrea varnier <[EMAIL PROTECTED]> wrote: > Hi :) > in your plugins (I'm studying from the best here :))) I often f

[jQuery] Re: how to insert javascript code instead of text with .before() or anything else jQuery has?

2008-08-18 Thread Ryura
.before('google code here') You'll want to escape any 's. On Aug 18, 6:49 pm, Cormac <[EMAIL PROTECTED]> wrote: > Hello everyone, > > I'm new to jQuery (and to programming, as a matter of fact). Still, I > have this task: find a certain element on an html page and insert a > google ad before it

[jQuery] Re: getJSON - how do you make it work?

2008-08-18 Thread Ryura
Is it actually accessing the file correctly? I'd say provide a test case or check yourself with Firebug. On Aug 18, 6:00 am, Jon Sidnell <[EMAIL PROTECTED]> wrote: > Hi > > I'm trying to get some JSON content using the $.getJSON function, but > it just won't work!! > > I started out using ASP.NET

[jQuery] Re: Some If/Then help

2008-07-11 Thread Ryura
Richard's didn't work because he formed an array instead of an object like he was planning. Replacing the [ ... ] with { ... } should've made it work. On Jul 11, 4:13 pm, brendan <[EMAIL PROTECTED]> wrote: > Thanks Richard, I couldn't get yours to work (my js knowledge is > pathetically rusty) an

[jQuery] Re: How to know when you can't scroll any further

2008-07-10 Thread Ryura
try it this way instead: > > $('element').scroll(function() { >      if (this.scrollTop + $(this).height() == this.scrollHeight) { >         //  console.log('finished'); >      } > > }); > > --Karl > > Karl Swedbergwww.englishr

[jQuery] Re: How to know when you can't scroll any further

2008-07-10 Thread Ryura
$("element").scroll(function() { if($("element").scrollTop == $("element").scrollHeight;) { //do something } }); Untested, but should work. On Jul 10, 9:18 am, fambi <[EMAIL PROTECTED]> wrote: > Thanking you guys in advance for any help/advice... > > How can I know that I've reach

[jQuery] Re: Cross domain problems

2008-07-09 Thread Ryura
What JS error were you getting before? On Jul 9, 8:01 am, flycast <[EMAIL PROTECTED]> wrote: > I tried setting document.domain = 'site.com'; > It works with a domain of site.com but notwww.site.com. I now get the > following message: > > [Exception... "'Permission denied to call method XMLHttpReq

[jQuery] Re: getJSON callback not executing

2008-06-26 Thread Ryura
Use a GET request. On Jun 26, 2:38 pm, wellmoon <[EMAIL PROTECTED]> wrote: > After more research I discovered for jsonp callbacks to work, the PHP > needs to return the name of the function as well as (which the flicker > service does in the $.getJSON example), so I added this to the PHP > file

[jQuery] Re: Remove a plugin from elements

2008-06-09 Thread Ryura
Try cloning the object before enabling the plugin, then once the plugin should be disabled replace it with the old object. On Jun 9, 10:38 am, SiCo <[EMAIL PROTECTED]> wrote: > Does anyone have any information on this? Or how to do it other than > removing the plugin. i.e. enable table drag and d

[jQuery] Re: jQuery - clueTip : how to disable it ?

2008-05-25 Thread Ryura
I tend to store the object before tooltip cloned in a variable, then when the tooltip is no longer needed, remove the old object and do a nice after(var); ie: var x = $("#id").clone(); x.clueTip(); $("#id").remove().after(x); On May 25, 9:18 am, Lideln <[EMAIL PROTECTED]> wrote: > Hi all, > > I

[jQuery] Re: jQuery is not defined and fade

2008-05-22 Thread Ryura
You need to use the script src to jQuery before pngfix. On May 22, 7:18 pm, Marcos <[EMAIL PROTECTED]> wrote: > Im getting problems with Jquery. In firefox show jQuery is not > defined. I think that this is due to pngfix. But I dont lnow how to > solve. Another problem its with fade and png tr

[jQuery] Help optimize my code!

2008-05-22 Thread Ryura
Hi everyone, I'm using the curvyCorners plugin, but I only want the corners to be curved when you're hovering over the element. Currently I've got this working but it's terrribly slow and, I fear, inefficient. $(function() { var clone;

[jQuery] Re: second time jquery is included, kills previously called plugins

2008-05-19 Thread Ryura
You should be able to use jQuery.noConflict() to restore $ to the first instance of jQuery where the plugins are. On May 18, 9:33 pm, Shelane <[EMAIL PROTECTED]> wrote: > if you have this in this order, the plugin call won't work. it will > give an error that the plugin function is not defined >

[jQuery] Re: How do I write this jquery expression?

2008-05-15 Thread Ryura
var id = $("div.subNav:visible").attr("id"); On May 15, 5:28 pm, "[EMAIL PROTECTED]" <[EMAIL PROTECTED]> wrote: > Hi, > > I have a number of DIVs with class = "subNav". How do I write a > Jquery expression to tell me the ID of the DIV with class "subNav" > whose display element is not "none" (i.

[jQuery] Re: document.createElement equivalent in jquery?

2008-05-14 Thread Ryura
$ (document.createElement("div")).attr("id","error").text(json.bad).prependTo("body"); That works just fine, obviously you can mold it to your own needs. But indeed, for dynamic script tags use getScript or getJSON. On May 14, 7:48 pm, Carl Von Stetten <[EMAIL PROTECTED]> wrote: > meppum, > > T

[jQuery] Re: Dynamic Software causing many script loads, how would one handle this?

2008-05-11 Thread Ryura
You *could* have a PHP that you call with $.getScript that'll use the GET variables to spit out specific javascript depending on the plugins, but that's a pretty lame way of doing things. On May 11, 6:58 pm, "Lee O" <[EMAIL PROTECTED]> wrote: > I have an application that has many plugins, all of

[jQuery] Re: "$(document).ready(function() {" giving error "$ is not a function" - what am I doing wrong?

2008-05-08 Thread Ryura
cherry austin - good idea, but not quite :) Kenthumphrey, You've declared jQuery.noConflict(); . This reverts $ back to its previous value, in this case undefined. Either remove jQuery.noConflict() or replace $(document).read(function(){}); with jQuery(document).ready(function($){}); On May 8, 8

[jQuery] Re: this pointer in Jquery ?

2008-04-26 Thread Ryura
$(function() { $('form a').click(function() { $(this).parent('form').submit(); return false; }); }); Try that. On Apr 26, 1:38 pm, mumuri <[EMAIL PROTECTED]> wrote: > Hello > > for the moment to submit a form ,i do like this (the a href is wrapped > in a form tag) > > > > but i wou

[jQuery] Re: Ajax loading/please-wait image

2008-04-25 Thread Ryura
Instead of using $.post, use $.ajax. This has far more options like beforeSend which will let you control the timing of your image. On Apr 25, 3:29 pm, Shane <[EMAIL PROTECTED]> wrote: > Hi, > > I want to add your typical 'Loading' animated gif to a page while it's > updating via ajax. I'm trying

[jQuery] Re: Error-Message: is not a function

2008-04-20 Thread Ryura
If I recall correctly, match() always returns an array. Try: catid = $(this).attr("name").match(/\[.+\]/) [0]; On Apr 20, 3:41 pm, Sen <[EMAIL PROTECTED]> wrote: > No ideas?

[jQuery] Re: How can I check what button was clicked

2008-04-05 Thread Ryura
Hola, You'd want to do something like this, probably: $("input").click(function() { var foo = $(this).attr("name"); //do something }); Alternatively you could just set a click event to each one. $("#edit_1").click(function() { //do something... }); $("#edit_2").click(function() {

[jQuery] Re: Getting started

2008-02-24 Thread Ryura
The documentation is essentially this. http://docs.jquery.com/Main_Page Click the various links under jQuery API Reference. On Feb 24, 4:51 am, jonpren <[EMAIL PROTECTED]> wrote: > Hi, > > Is there anywhere listed all functions that is added by including > jquery? > > Best Regards - Jon

[jQuery] How to center div horizontally + vertically?

2008-02-18 Thread Ryura
Hi everyone, I'm wondering the best way to center a div horizontally and vertically on the fly. I have: jQuery("a").click(function () { jQuery("#box")./*verticalCenter().*/ add("#loading").show(); }); Basically I just want #box to be centered on the screen and then s

[jQuery] Re: Grabbing hash mark

2008-02-10 Thread Ryura
Oh, it occurred to me you might have wanted to find this for a link on the page instead of the current url in the browser. If that's the case, you would do something like this: var b = $('a').attr("href").split("#")[1];

[jQuery] Re: Grabbing hash mark

2008-02-10 Thread Ryura
var a = window.location.href.split("#")[1]; On Feb 10, 9:50 am, frizzle <[EMAIL PROTECTED]> wrote: > Hi there, > > I was wondering how to grab the contents of everything behind the hash > mark ( # ) in a URL. > I could not find it on the Jquery site... > > Thanks, > Frizzle.

[jQuery] Using JSONP...I'm clueless.

2007-12-24 Thread Ryura
;; $.ajax({ type: "GET", url: "http://somedomain.net/jsonp/selection.php";, dataType: "jsonp", data: "foo="+gomon, success: function(gata){ alert(gata.go[3]].repping) } }); selection.php basically is echoing this: ({ "go": [ {"

[jQuery] Re: Looping ajax requests

2007-12-19 Thread Ryura
Thanks for all the responses everyone! I found an alternate solution (probably proprietary to the situation I was in) but I'll look to use Michael's method in the future.

[jQuery] Looping ajax requests

2007-12-18 Thread Ryura
ata){ alert(i); } })}; This alerts "5" 4 times. Interestingly, it correctly gets 4 pages: http://example.com/5740/1/page.html http://example.com/5740/2/page.html http://example.com/5740/3/page.html http://example.com/5740/4/page.html What is the solution? Thanks, Ryura

[jQuery] iFrames and jQuery

2007-12-04 Thread Ryura
I need to grab content from an iFrame, preferably using jQuery. However, I have no clue how to do this. First off, I'm inserting the iFrame into the page: $(function() { $("#divID").after("