[jQuery] jcarousel and ajax

2008-11-28 Thread matt

I have a site that uses jcarousel.  This works fine, but I also have
links on the side, that when clicked, loads in new content via ajax
(new page content and new carousel).  The problem is that jcarousel
stopped working, using this message:

jCarousel: No width/height set for items. This will cause an infinite
loop. Aborting..

Ok, so no problem, I'll just use livequery to fix the problem.  Well
it added the images to the carousel, and started to cycle through, but
I still got this message:

jCarousel: No width/height set for items. This will cause an infinite
loop. Aborting..

Even when I'm loading in pages via ajax that do not have the ID that
utilizes the jcarousel, I get the error message.  Anyone have any idea
how to fix this?


[jQuery] Re: Jeditable, async value

2008-11-28 Thread Mika Tuupola



On Nov 27, 2008, at 6:37 PM, Viktor wrote:



If the server responses I wanna set the title to the new value
else
I'd like to use the old value

$(.title).editable(function(value, settings)
{
setTitle(function()
{
// return value
}, function()
{
 // return old_value
},
value);

}, {
submit  : 'OK'
});




Are you actually calling setTitle() function at some point? Do you  
have example code somewhere onlne?


Mika Tuupola
http://www.appelsiini.net/



[jQuery] [Cluetip] don't work

2008-11-28 Thread Zic Puce
Hello all, 

I work with the framework phpmvc and code with the MVC architecture. 
I want to insert a popup should recover in xml file some info. 

So I try basically the example given Demo Cluetip by downloading the file. 
All examples walk locally. 

Now I take the example code 1 basic tip from title in Default Style that I 
put in my file header.tpl. 
Namely:

[code]
script src=../jquery-1.2.5.min.js type=text/javascript/script script 
src=../jquery.hoverIntent.js type=text/javascript/script
  script src=../jquery.cluetip.js type=text/javascript/script
  script src=demo.js type=text/javascript/script
  link rel=stylesheet href=../jquery.cluetip.css type=text/css /
  link rel=stylesheet href=demo.css type=text/css /
[/code]

I am very careful to place the file and *. js *. css in the right folder. 

After, I place the code in the body :
[code]
div id=container
 div id=examples 
ol
 li  
a class=title href=# title=This is the title|The 
first set of body content comes after the first delimiter in the title.|In this 
case, the delimiter is a pipe.Exemple/a   
/li
/ol
/div
/div
[/code]

I do not modify anything in the *. js, or *. css. 
But here I will not display correctly popup title contrary to the example 
locally. It appears as a classic title.

If I modify simply this line :
[code]
a class=title href=# title=This is the title|The first set of body 
content comes after the first delimiter in the title.|In this case, the 
delimiter is a pipe.Exemple/a
[/code]

by
[code]
a class=basic href=ajax.htm rel=ajax.htmExemple/a
[/code]

Now, it appears nothing et I place the ajax.html in the good folder.
I don't understand
What do I missing?

HELP, HELP
Thanks
Benoit


[jQuery] Re: Draggable() doesn't work with table rows?

2008-11-28 Thread ajpiano

http://www.isocra.com/2008/02/table-drag-and-drop-jquery-plugin/

is a plugin that makes this possible

--adam

On Nov 28, 5:01 am, seasoup [EMAIL PROTECTED] wrote:
 That's different.  The tr/tr doesn't need to leave the table, if
 you could make a tr draggable, you'd have to drop it in another table
 at the least

 On Nov 27, 9:43 pm, René [EMAIL PROTECTED] wrote:

  Actually, sortable() lets you drag rows between tables, so I don't
  think it's impossible.

  On Nov 27, 4:34 pm, seasoup [EMAIL PROTECTED] wrote:

   I don't think you can drag table rows... it would remove them from the
   table...

   On Nov 27, 3:11 pm, René [EMAIL PROTECTED] wrote:

I can drag and sort lists.
I can sort tables.
I can drag entire tables.

But I can't drag individual table rows. Anyone know how to do it?
Here's some sandbox code:

ul id=list
li id=a_1 class=drag1The/li
li id=a_2 class=drag1slow/li
li id=a_3 class=drag1green/li
li id=a_4 class=drag1turtle/li
/ul

table id=table
tbody id=rows
tr id=a_1 class=drag2tdThe/td/tr
tr id=a_2 class=drag2tdquick/td/tr
tr id=a_3 class=drag2tdbrown/td/tr
tr id=a_4 class=drag2tdfox/td/tr
/tbody
/table

script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/jquery/1.2.6/jquery.min.js/script
script type=text/javascript src=http://ajax.googleapis.com/ajax/
libs/jqueryui/1.5.2/jquery-ui.min.js/script
script type=text/javascript

$(document).ready(function() {
        $('.drag1').draggable();                // WORKS
//      $('#list').sortable();                  // WORKS
//      $('#rows').sortable();                  // WORKS
//      $('#table').draggable();                // WORKS
//      $('#rows').draggable();                 // DOESN'T WORK  -- ?
        $('.drag2').draggable();                // DOESN'T WORK  -- ?
//      $('#a_1').draggable();                  // DOESN'T WORK  -- ?
        });

/script


[jQuery] Re: Flow control in functions.....

2008-11-28 Thread Paul Mills

Put all the code you want executed after the post is complete into the
callback function.

or

Change chkmail function to call a new function (with the password and
email checks) instead of returning emailerror.

Paul

On Nov 27, 4:12 pm, QuadCom [EMAIL PROTECTED] wrote:
 I may have titled this wrong but that is the best description I could
 think of being a newbie.

 I have a function the inside calls another function. What I need to
 have happen is for the calling function to wait for a response from
 the called function but that is not what is happening. The calling
 function goes right on processing the rest of the script which of
 course errors out because the required vars are not set properly yet.

 Here is some code

 var chkmail = function(data){
         if (data.exists == 1){
                 $('#emailerror').show();
                 var emailerror = 1;
         }
         else{
                 $('#emailerror').hide();
                 var olde = $('#editaemail').val();
                 var emailerror = 0;
         }

         return emailerror;

 }

 //This is the pre submit function for the Jquery form plugin
 function presub(){
         \\get the new email address entered in the form
         newe = $('#editaemail').val();

         \\set the url var so IE won't cache the ajax call
         url = '/myaccount/process.cfm?t=' + new  Date().getTime();

         \\password change test vars
         p1 = $('#editapassword1').val();
         p2 = $('#editapassword2').val();

         \\default error state vars set to 0
         emailerror = 0;
         passworderror = 0;

         \\UI update to notify client
         $('#editasave').attr(disabled,disabled).attr(value,One
 Moment);

        \\Test old email (set at doc.ready) to new email to see if they
 are different
        if(olde != newe){
                 \\send new email through post to search DB for existing
                 \\returns JSON either {exists:1} or {exists:0}
                 \\callback set to fire chkmail()
                 $.post(url, {checkname: newe}, chkmail, json);
         }

         \\Check password fields to see if they are the same
         if (p1 != p2){
                 $('#passerror').show();
                 passworderror = 1;
         }
         else{
                 $('#passerror').hide();
         }
         if(emailerror == 0  passworderror == 0) {
                 return true;
         }
         else{
                 $('#editasave').removeAttr(disabled).attr(value,Save
 Changes);
                 return false;
         }

 }

 After the $.post functions callback is triggered the script continues
 on to the password checks and since the $.post function hasn't
 received a response yet, the system doesn't catch the errors with the
 email address.

 I'm sure there is a more robust way of doing this but as I said
 earlier, I am a newbie to JS and learning as I go.

 Any help would be appreciated.


[jQuery] Re: [validate] remote checking and apache rewrite problem

2008-11-28 Thread jurkoferko

No, there is no redirect involved, and i managed to identify the
problem:

The second script, which used Apache rewrite was displaying also some
html content, not only 'true' or 'false' ... I didn't notice it first,
because the only thing my php script was displaying was 'true' or
'false', but when i checked source code i immediatelly realised, that
the php script was displaying also some html tags. That was my
problem, i fixed the output and it's now working fine.

Thanks for your answer.

On 27. Nov, 17:07 h., Jörn Zaefferer
[EMAIL PROTECTED] wrote:
 Is there a redirect involved? If so, my guess is that the
 XMLHttpRequest doesn't follow the redirect, just gets the 30x code and
 no response body.

 I don't think the plugins can do anything about that...

 Jörn

 On Thu, Nov 27, 2008 at 12:02 PM, jurkoferko [EMAIL PROTECTED] wrote:

  Hi i have a problem with remote checking. I have two identical
  scripts, both of them return 'true' or 'false':

  1. /something.php
  2. /script/something

  When i use the first PHP script in remote, javascript sends data to
  the PHP script and PHP sends data to javascript. Everything is working
  OK.
  But when i use the second PHP script in remote, which is executed
  the same way as the first, but the difference is, that this second
  script is handled through Apache's rewrite function, this second
  script sends data to PHP correctly but receives NO ANSWER. Although
  the script itself displays 'true' or 'false' when you call it directly
  from the browser.

  Is there any way that remote checking in jquery's validate will work
  with apache's rewrite ? Or am I doing something wrong ?


[jQuery] Re: Lightbox/ThickBox/ui.dialog etc

2008-11-28 Thread Lee McMullen
Thanks Jack, i'll take a look.

Lee.

On Thu, Nov 27, 2008 at 8:49 PM, Jack Killpatrick [EMAIL PROTECTED] wrote:


 check this one out, I think it will do all that you need:

 http://dev.iceburg.net/jquery/jqModal/

 - Jack

 Lee Mc wrote:
  Hi there,
 
  Does anyone have an opinion on what they think is the best lightbox
  implementation to use?
 
  It's not going to be used to display images, it's mainly form
  interaction. My only caveat's are:
 
  - Must be draggable
  - Must (unfortunately) work in IE6
  - Must be modal
 
  I've been playing with ui.dialog and really like it.  However I seem
  to be having some issues in IE6 - using the same theme as displayed on
  this page:
 
  http://dev.jquery.com/view/trunk/ui/demos/functional/#ui.dialog
 
  The close image on the title bar is causing some layout issues and
  also select elements from the underlying content are appearing
  through into the content of the dialog.
 
  A quick search brought back this: http://jquery.com/demo/thickbox/.
  Appears to do everything required except be draggable.
 
  Can anyone point me in the right direction?
 
  Cheers,
  Lee
 
 



 



[jQuery] Re: how to call a function at outside object in jQuery's click function?

2008-11-28 Thread Yam.

thank you!
it works well!

On Nov 28, 1:47 am, ricardobeat [EMAIL PROTECTED] wrote:
 Try this:

 var Example = function(){};
 Example.prototype = {

  abobora: function(){
     alert('Hi!');
   },

   execute: function(){
     var t = this;
     $('#any_button').click(function(){

      t.abobora();

     });
   }

 };

 - ricardo

 On Nov 27, 7:39 am, Yam. [EMAIL PROTECTED] wrote:

  I met a small problem that an outside 'example' object does not be got
  in a 'click' function.
  would you tell me how to do that?

  ==
  example code:
  ==

  var Example = function(){};
  Example.prototype = {

    i_want_to_call_this_function: function(){
      alert('Hi!');
    },

    execute: function(){
      $('#any_button').click(function(){

        // How to call 'i_want_to_call_this_function' from here?

        // this.i_want_to_call_this_function(); // - Unknown. i know a
  'this' object pointed to html object.

      });
    }

  };

  var example = new Example();
  example.execute();


[jQuery] After refresh $(document).ready shows different value for select from change

2008-11-28 Thread xiaohouzi79

The following two are giving different results:

$(#service_select).change(function() {
   alert($(#service_select).val());
}

$(document).ready(function() {
   if ($(#service_select option:selected)) {
  alert($(#service_select).val());
   }
}


Onchange I get the option value. On document ready I get the text.

So when I choose something from the select element I get 2,3,4 etc.

But on reload I get 'Alpha', 'Beta', 'Gamma' etc..

This is happening in both IE and Firefox.

I want to trigger events based upon the selected value, but I don't
want to use the text as this may change.

Any ideas?

Thanks,
Tim.


[jQuery] [Tooltip]

2008-11-28 Thread Robert Heine

I'm using the tooltip-plugin from Jörn Zaefferer and it's really cool.

Until today it had everything i needed, but now i need some
functionality where the tooltip itself is hoverable, so i'm able to
click the links in it for example like on this page:http://
www.cssplay.co.uk/menu/balloons.html

In this example the tooltip hides, when the mouse does not enter the
tooltip and leaves the object, or when the mouse enters the tooltip
and leaves it again.

Would it be possible to achieve this with another option-parameter
hoverable: true|false ?


MfG,
Robert
www.deltatech-v2.de


[jQuery] Repeated ajax calls (jheartbeat) but not always (depending on a CURL response)

2008-11-28 Thread Spike1

Sorry for the obscure subject, but english is not my language.

Well, situation:

server side language: php

In a page, i need to call an url (on another server) that start a
process (creates a jar file assembling many other files).

This call will be done via curl (it has been already written).

If the result of this call is Ko, stop everything. If it is OK, I must
call (let's name this call, second call) another url which output can
be:

1) Error - Stop everything
2) Wait, not finished
3) The file is ready

If 1, ok I'll print out a message
If 3 I'll print out a link to download the file
If 2 I need to call again the url (and so on, until I get 1 or 3)

I thought to use jheartbeat (http://www.ajtrichards.co.uk/heartbeat/)
to make my 'second call' , but since I'm noob, I don't know how to
make these 2 things:

A) Launch heartbeat only if the result of the curl call is OK
B) Evaluate the 'response' of the 'second call' and stop heartbeat if
the response is 1 or 3 (then I'll append someway the message or the
link).

I think I could attach heartbeat to a button (visible only if the curl
call response is OK) and trigger the onclick or onmouseover event, but
I'd prefer having it starting automatically if the curl call response
is OK.

Any hint about both A and B?

Thank you in advance, Paolo


[jQuery] [autocomplete] Changing query parameter

2008-11-28 Thread Osymandias

Hi all,

Wondering how to change the actual query parameter sent by jquery at
run time: e.g. instead of

services?q=foo

I might want to do

services?term=foo,

and this will change depending on where I'm using the plugin.


[jQuery] How does clone() work?

2008-11-28 Thread Vaskerville


I'm having the worst time working with clone(). It returns an object...still
can't access it.

What I'm doing is looping through a list of divs (same class) and trying to
clone each one. I want to clone them so that I can reorder them.

var html;

// in the loop
html += $('#myDiv-' + id).clone();

Is what I think should work...but I just get objects.

Any tips here on this one?

Thanks
-- 
View this message in context: 
http://www.nabble.com/How-does-clone%28%29-work--tp20731606s27240p20731606.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] can not append a to body in IE

2008-11-28 Thread Serge

Hi guys, you can see jQuery code below, it works in Firefox and Opera
for me, but does not work in IE6.

$(function() {
var a = $('a').attr('href', 'javascript://').append('test');
$('body').append(a);
});


[jQuery] Re: Lightbox/ThickBox/ui.dialog etc

2008-11-28 Thread webRat

http://planetozh.com/projects/lightbox-clones/

On Nov 27, 9:36 am, Lee Mc [EMAIL PROTECTED] wrote:
 Hi there,

 Does anyone have an opinion on what they think is the best lightbox
 implementation to use?

 It's not going to be used to display images, it's mainly form
 interaction. My only caveat's are:

 - Must be draggable
 - Must (unfortunately) work in IE6
 - Must be modal

 I've been playing with ui.dialog and really like it.  However I seem
 to be having some issues in IE6 - using the same theme as displayed on
 this page:

 http://dev.jquery.com/view/trunk/ui/demos/functional/#ui.dialog

 The close image on the title bar is causing some layout issues and
 also select elements from the underlying content are appearing
 through into the content of the dialog.

 A quick search brought back this:http://jquery.com/demo/thickbox/.
 Appears to do everything required except be draggable.

 Can anyone point me in the right direction?

 Cheers,
 Lee


[jQuery] Re: Lightbox/ThickBox/ui.dialog etc

2008-11-28 Thread Richard D. Worth
On Thu, Nov 27, 2008 at 9:36 AM, Lee Mc [EMAIL PROTECTED] wrote:


 - Must be draggable
 - Must (unfortunately) work in IE6
 - Must be modal

 I've been playing with ui.dialog and really like it.  However I seem
 to be having some issues in IE6 - using the same theme as displayed on
 this page:

 http://dev.jquery.com/view/trunk/ui/demos/functional/#ui.dialog


I recommend grabbing a pre-made or custom (roll-your-own) theme from
http://ThemeRoller.com/




 The close image on the title bar is causing some layout issues and
 also select elements from the underlying content are appearing
 through into the content of the dialog.


This is fixed by including the bgiframe plugin and including bgiframe:true
in the dialog options. See http://docs.jquery.com/UI/Dialog/dialog#options

- Richard


[jQuery] Re: Lightbox/ThickBox/ui.dialog etc

2008-11-28 Thread Lee McMullen
@Richard - Thanks for that, I'll take a look at the fix you recommended.
I'd much prefer to use ui.dialog so hopefully your recommendation will work
on IE6.

@webRat - thanks for that site - useful resource.  I have other projects
bubbling away on prototype so this will come in handy.

Cheers,
Lee

On Fri, Nov 28, 2008 at 1:11 PM, Richard D. Worth [EMAIL PROTECTED] wrote:


 On Thu, Nov 27, 2008 at 9:36 AM, Lee Mc [EMAIL PROTECTED] wrote:


 - Must be draggable
 - Must (unfortunately) work in IE6
 - Must be modal

 I've been playing with ui.dialog and really like it.  However I seem
 to be having some issues in IE6 - using the same theme as displayed on
 this page:

 http://dev.jquery.com/view/trunk/ui/demos/functional/#ui.dialog


 I recommend grabbing a pre-made or custom (roll-your-own) theme from
 http://ThemeRoller.com/




 The close image on the title bar is causing some layout issues and
 also select elements from the underlying content are appearing
 through into the content of the dialog.


 This is fixed by including the bgiframe plugin and including bgiframe:true
 in the dialog options. See http://docs.jquery.com/UI/Dialog/dialog#options

 - Richard



 



[jQuery] Form Editor like WUFOO.com with JQUERY??

2008-11-28 Thread eutelsat

Please can you help me to decide which tecnology is more appropiate?
YUI, JQUERY or just another Library

Hi I'm planning to develop something like a Form Editor in WUFOO with
JQUERY.
Needing Drag  Drop and object graphical selector moreover some custom
code.

Thanks in advance
Jordi


[jQuery] Re: Draggable() doesn't work with table rows?

2008-11-28 Thread seasoup

That's different.  The tr/tr doesn't need to leave the table, if
you could make a tr draggable, you'd have to drop it in another table
at the least

On Nov 27, 9:43 pm, René [EMAIL PROTECTED] wrote:
 Actually, sortable() lets you drag rows between tables, so I don't
 think it's impossible.

 On Nov 27, 4:34 pm, seasoup [EMAIL PROTECTED] wrote:

  I don't think you can drag table rows... it would remove them from the
  table...

  On Nov 27, 3:11 pm, René [EMAIL PROTECTED] wrote:

   I can drag and sort lists.
   I can sort tables.
   I can drag entire tables.

   But I can't drag individual table rows. Anyone know how to do it?
   Here's some sandbox code:

   ul id=list
   li id=a_1 class=drag1The/li
   li id=a_2 class=drag1slow/li
   li id=a_3 class=drag1green/li
   li id=a_4 class=drag1turtle/li
   /ul

   table id=table
   tbody id=rows
   tr id=a_1 class=drag2tdThe/td/tr
   tr id=a_2 class=drag2tdquick/td/tr
   tr id=a_3 class=drag2tdbrown/td/tr
   tr id=a_4 class=drag2tdfox/td/tr
   /tbody
   /table

   script type=text/javascript src=http://ajax.googleapis.com/ajax/
   libs/jquery/1.2.6/jquery.min.js/script
   script type=text/javascript src=http://ajax.googleapis.com/ajax/
   libs/jqueryui/1.5.2/jquery-ui.min.js/script
   script type=text/javascript

   $(document).ready(function() {
   $('.drag1').draggable();// WORKS
   //  $('#list').sortable();  // WORKS
   //  $('#rows').sortable();  // WORKS
   //  $('#table').draggable();// WORKS
   //  $('#rows').draggable(); // DOESN'T WORK  -- ?
   $('.drag2').draggable();// DOESN'T WORK  -- ?
   //  $('#a_1').draggable();  // DOESN'T WORK  -- ?
   });

   /script


[jQuery] Re: Using fade on .toggleClass

2008-11-28 Thread Paul Collins
Hi Ricardo,

I'm not sure why I said this was working last week, but it doesn't seem to
be! I must have been drunk at the time :)

Sorry to keep bothering you, but when I click on the link, nothing happens
now. I've tried placing alerts and so forth and I've tracked it down to this
line as the problem (I think):

thiz.stop(true,true).fadeIn();

I'm not good enough at Javascript to debug this, been trying for a while.
Here is the full code again:

$.fn.fadeToggle = function(){
   var thiz = $(this);
   return thiz.is(':visible') ? thiz.stop(true,true).fadeOut() :
thiz.stop(true,true).fadeIn();
};
$(function() {
$(#signInForm).addClass(hide);
$(#profileLinks li.userEmail strong).hover(function(){
   $(this).addClass('hover');
 }, function() {
   $(this).removeClass('hover');
   }).click(function(){
   $(#signInForm).fadeToggle();
});
});


Any help would be appreciated, I'm stuck!



2008/11/19 Paul Collins [EMAIL PROTECTED]

 That works perfectly, thanks Ricardo, really appreciate it.

 Thanks for taking the time
 Paul


 2008/11/19 ricardobeat [EMAIL PROTECTED]:
  IDs should be unique, so there's no point in having all those
  selectors. You can also chain the methods for strong, saves you time
  from finding the element again.
 
  For the 'slide' effect there is a toggle function (slideToggle), but
  you'll have to implement your own for a fade effect:
 
  $.fn.fadeToggle = function(){
 var thiz = $(this);
 return thiz.is(':visible') ? thiz.stop(true,true).fadeOut() :
  thiz.stop(true,true).fadeIn();
  };
 
  $(function() {
 $(#signInForm).addClass(hide);
 $(#profileLinks li.userEmail strong).hover(function(){
$(this).addClass('hover');
  }, function() {
$(this).removeClass('hover');
}).click(function(){
$(#signInForm).fadeToggle();
 });
  });
 
  - ricardo
  On Nov 19, 10:10 am, Paul Collins [EMAIL PROTECTED] wrote:
  Hi all,
 
  I'm trying to make something fade in and out when I use toggleClass
  to show and hide. I've been looking around for a while and can't see
  if it's possible. Here is my code:
 
  $(function() {
  $(#topArea ul#profileLinks li.userEmail
 form#signInForm).addClass(hide);
  $(#topArea ul#profileLinks li.userEmail
 strong).hover(function(){
  $(this).addClass('hover');
  }, function() {
  $(this).removeClass('hover');
  $(#topArea ul#profileLinks li.userEmail
 strong).click(function(){
  $(#topArea ul#profileLinks li.userEmail
  form#signInForm).toggleClass('show');
  });
  });
 
  });
 
  Would appreciate any help.
  Cheers
  Paul



[jQuery] Re: Form Editor like WUFOO.com with JQUERY??

2008-11-28 Thread temega

jQuery has great Drag and Drop features

On Nov 28, 10:27 am, eutelsat [EMAIL PROTECTED] wrote:
 Please can you help me to decide which tecnology is more appropiate?
 YUI, JQUERY or just another Library

 Hi I'm planning to develop something like a Form Editor in WUFOO with
 JQUERY.
 Needing Drag  Drop and object graphical selector moreover some custom
 code.

 Thanks in advance
 Jordi


[jQuery] jQuery.uploader released: Flash based jQuery uploader

2008-11-28 Thread Gilles (Webunity)

Hi guys,

Short memo;
http://jQuery.webunity.nl/

Check it out, 2 demo's online!

-- Gilles


[jQuery] Re: Form Editor like WUFOO.com with JQUERY??

2008-11-28 Thread Olivier Percebois-Garve
jQuery itself has no drag and drop feature.
That kind of interaction is within jQuery-ui which is built on top of
jQuery.




On Fri, Nov 28, 2008 at 3:17 PM, temega [EMAIL PROTECTED] wrote:


 jQuery has great Drag and Drop features

 On Nov 28, 10:27 am, eutelsat [EMAIL PROTECTED] wrote:
  Please can you help me to decide which tecnology is more appropiate?
  YUI, JQUERY or just another Library
 
  Hi I'm planning to develop something like a Form Editor in WUFOO with
  JQUERY.
  Needing Drag  Drop and object graphical selector moreover some custom
  code.
 
  Thanks in advance
  Jordi



[jQuery] Re: How does clone() work?

2008-11-28 Thread MorningZ

but I just get objects

Are you expecting something else?  the .clone() method, like most of
the whole jQuery API returns a jQuery wrapped object

to get the HTML of a cloned item, you'll need to use the .html()
method.  and you also need to be very aware, that .clone() will
bring the id of the object to the new object as well, which could
cause issues on future selectors strings

And last note, why would you make copies of objects just to reorder
them?  that doesn't make much sense



On Nov 28, 4:54 am, Vaskerville [EMAIL PROTECTED] wrote:
 I'm having the worst time working with clone(). It returns an object...still
 can't access it.

 What I'm doing is looping through a list of divs (same class) and trying to
 clone each one. I want to clone them so that I can reorder them.

 var html;

 // in the loop
 html += $('#myDiv-' + id).clone();

 Is what I think should work...but I just get objects.

 Any tips here on this one?

 Thanks
 --
 View this message in 
 context:http://www.nabble.com/How-does-clone%28%29-work--tp20731606s27240p207...
 Sent from the jQuery General Discussion mailing list archive at Nabble.com.


[jQuery] Re: jQuery timing out on page load

2008-11-28 Thread ricardobeat

Well, that's a mistery. Two unlikely possibilities:

1. the packed jquery has an error, use the minified version
2. some function on your page is doing something with the '$' variable

Do you have a page online we can look at?

On Nov 28, 5:06 am, harryhobbes [EMAIL PROTECTED] wrote:
 The path is right and I'm using the packed version. There may be js on
 the page, but nothing is using jquery because I haven't enabled the
 page to use it yet. Basically I have a site that i'm incrementally
 adding jquery so that every page has a degree of degradation to it.

 On Nov 28, 1:30 am, Liam Potter [EMAIL PROTECTED] wrote:

  I'm guessing the path is wrong, are you using absolute paths or relative?

  ricardobeat wrote:
   It shouldn't timeout if you're not running any functions, are you
   using the packed version? Are you sure you don't have any javascript
   code on these pages?

   On Nov 11, 3:01 am, harryhobbes [EMAIL PROTECTED] wrote:

   Hi,

   I've got jQuery loading by default on my site. The library is only
   used on some pages in my site, however when I load a page that isn't
   using jquery (but still loading the file in the html header) Firefox
   pops up with a warning that jquery is timing out.

   Any suggestions?

   Cheers


[jQuery] Re: How does clone() work?

2008-11-28 Thread Vaskerville


Yes, it didn't make sense...I found out the hard way after getting though
things that clone() was the wrong way to go. But, at least I learned how it
worked...another nice Jquery tool.

I ended up simply using the div id's and prependTo() to work things out.

Thanks



Vaskerville wrote:
 
 I'm having the worst time working with clone(). It returns an
 object...still can't access it.
 
 What I'm doing is looping through a list of divs (same class) and trying
 to clone each one. I want to clone them so that I can reorder them.
 
 var html;
 
 // in the loop
 html += $('#myDiv-' + id).clone();
 
 Is what I think should work...but I just get objects.
 
 Any tips here on this one?
 
 Thanks
 

-- 
View this message in context: 
http://www.nabble.com/How-does-clone%28%29-work--tp20731606s27240p20736536.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] how can i find() including self?

2008-11-28 Thread Mark Gibson

With the follow style of markup:

div id=my-combo role=combobox aria-owns=my-list another-thing
/div

div id=my-list role=list
/div

I need to find the first element of type [role=list], in either the
descendants
of #my-combo, or the elements (and descendants) identified in aria-
owns.

I was think of creating a plugin to make this easier:

$('#my-combo').owns('[role=list]:first');

$.fn.owns = function(selector) {
// Gather all the id's from aria-owns attrs, appending '#' to each,
and separate with ','
var include = $(this).filter('[aria-owns]').map(function() {
return this.getAttribute('aria-owns').replace(/([^\s]+)/g, '#
$1').replace(/\s+/g,',');
});

if (include.length) {
// Find all the referenced elements
var owned = $(Array.prototype.join.call(include,','));

// HELP NEEDED HERE!
// Here I need to pretend that the 'owned' elements are also
children of 'this'
// FakeElement(owned + this.children()).find(selector)
// or
// owned.add(this.children()).findIncSelf(selector)
} else {
return this.find(selector);
}
};

I'm puzzled as to how to combine the owned elements and the
descendants of the
context elements, and find the using the requested selector.
Any ideas?

Cheers
-Mark


[jQuery] Re: After refresh $(document).ready shows different value for select from change

2008-11-28 Thread ricardobeat

Can you put your problem code up at jsbin.com or somewhere? I couldn't
reproduce that.

- ricardo

On Nov 27, 11:05 pm, xiaohouzi79 [EMAIL PROTECTED] wrote:
 The following two are giving different results:

 $(#service_select).change(function() {
    alert($(#service_select).val());

 }

 $(document).ready(function() {
    if ($(#service_select option:selected)) {
       alert($(#service_select).val());
    }

 }

 Onchange I get the option value. On document ready I get the text.

 So when I choose something from the select element I get 2,3,4 etc.

 But on reload I get 'Alpha', 'Beta', 'Gamma' etc..

 This is happening in both IE and Firefox.

 I want to trigger events based upon the selected value, but I don't
 want to use the text as this may change.

 Any ideas?

 Thanks,
 Tim.


[jQuery] Making the accordian menu sticky

2008-11-28 Thread Low Kian Seong

Has anyone found a way to make the accordian menu sticky? As in it
doesn't close up and refresh itself everytime I visit a link?

Thanks.


[jQuery] Re: can not append a to body in IE

2008-11-28 Thread ricardobeat

Ignoring the fact that a javascript:// protocol doesn't exist, you
have to close/self-close the element tag you want to create:

$('a/').attr(); or
$('atest/a').attr()

- ricardo

On Nov 28, 9:01 am, Serge [EMAIL PROTECTED] wrote:
 Hi guys, you can see jQuery code below, it works in Firefox and Opera
 for me, but does not work in IE6.

 $(function() {
         var a = $('a').attr('href', 'javascript://').append('test');
         $('body').append(a);

 });


[jQuery] Re: how can i find() including self?

2008-11-28 Thread ricardobeat

I tried for 5 minutes but couldn't wrap my head around that :D

Why do you need to 'pretend the elements are children of this'? What
are you trying to achieve?

- ricardo

On Nov 28, 2:04 pm, Mark Gibson [EMAIL PROTECTED] wrote:
 With the follow style of markup:

 div id=my-combo role=combobox aria-owns=my-list another-thing
 /div

 div id=my-list role=list
 /div

 I need to find the first element of type [role=list], in either the
 descendants
 of #my-combo, or the elements (and descendants) identified in aria-
 owns.

 I was think of creating a plugin to make this easier:

 $('#my-combo').owns('[role=list]:first');

 $.fn.owns = function(selector) {
         // Gather all the id's from aria-owns attrs, appending '#' to each,
 and separate with ','
         var include = $(this).filter('[aria-owns]').map(function() {
                 return this.getAttribute('aria-owns').replace(/([^\s]+)/g, '#
 $1').replace(/\s+/g,',');
         });

         if (include.length) {
                 // Find all the referenced elements
                 var owned = $(Array.prototype.join.call(include,','));

                 // HELP NEEDED HERE!
                 // Here I need to pretend that the 'owned' elements are also
 children of 'this'
                 // FakeElement(owned + this.children()).find(selector)
                 // or
                 // owned.add(this.children()).findIncSelf(selector)
         } else {
                 return this.find(selector);
         }

 };

 I'm puzzled as to how to combine the owned elements and the
 descendants of the
 context elements, and find the using the requested selector.
 Any ideas?

 Cheers
 -Mark


[jQuery] code does not work if put after other codes

2008-11-28 Thread Betty

Hi, I'm new. I've written two pieces of code with jQuery. Each of them
works well individually. However, if I put them one after the other,
the first one still works, but the latter one will not work. If I
change their order, it's always the first that can work and the latter
one that can't work. Both pieces are quite simple, and I don't think
there is anything conflicting between them. To be more clear, the code
is something like this:

$(#button1).hover(function () {
  //do something
});
$(#button2).hover(function () {
  //do something else
});

No matter in which order I put the two, the second one just doesn't
work. I just don't understand. Is there a special rule to clear the
cache of function() or something? Any help will be much appreciated!


[jQuery] Re: warning: jquery in firefox 3

2008-11-28 Thread Henry

On Nov 27, 5:58 am, codz wrote:
 hello everyone,

 i just want to ask anybody about this warning that
 always show whenever my page load with the jquery.js file.

 Warning:

 test for equality (==) mistyped as assignment (=)?
 Source File:http://localhost:2008/jquery.js
 Line: 1161, Column: 32
 Source Code:
while ( elem = second[ i++ ] )

For a very long time it has been a common error in javascript to write
a single equals sign when attempting comparison. It can be a
misconception (where novices are concerned), a typo from even very
experienced javascript authors or, say, a momentary laps of
concentration from someone who switches between many languages
regularly.

So when Firefox sees an assignment operation in a context where
comparison would be more expected (such as the expressions for - if -,
- while - and so on) it puts up this warning to make it easier for the
programmer to find their mistakes.

One way of handling this to impose a bit of code 'style' discipline;
if you mean to use assignment in the expression of an - if -, - while
-, etc. statement you wrap parentheses around it. Thus - while ( elem
= second[ i++ ] ) - becomes - while ( (elem = second[ i++ ]) ) - and
then warnings stop. Thus the (otherwise superfluous) parentheses
perform two functions; they stop the warning and they act as a flag to
indicate that you really meant to be doing assignment instead of
comparison. Meaning that when you see assignment in one of those
contexts without the wrapping parentheses it would be correct to start
of suspecting a programmer error, while without the parentheses every
occurrence of a single equals sign in and - if - expressions looks
suspicious.

 anonymous function does not always return a value

That statement is technically false. All javascript function calls
return a value (always). If they don't return through an explicit
return statement then they return the undefined value (which is still
a value in javascript), if they return through a return statement that
does not have an expression then they also return the undefined value,
else they return through a return statement that has an expression and
the function call returns the value of that expression (which may
still be the undefined value).

Firefox's 'warnings' often make statements that are factually false.

This warning is about promoting a particular 'style' in code
authoring; it is felt that if any path through a function's code ends
in an explicit return statement (and especially one with an
expression)  then all possible paths through that function's code
should end with such a statement. It can be seen as an expression of
the completeness of the author's perception of the logic of the code
in the function; he/she has perceived all the possible paths through
the function (marking the end of each with an explicit return
statement), and so has not failed to observe some of the ways out of
the function.

'Style' (if not externally imposed (by, for example, an employer)) is
often seen as a matter of opinion and personal judgment. Personally I
like this particular style rule, but many others do not. I don't
particularly like the fact that Firefox/JavaScript(tm) elect to tell a
lie in there attempt to promote it. That is probably
counterproductive.

The thing to do with code 'style' rules is to apply critical judgment
to the rationale behind them and see what you think of the reasoning.
If you are convinced you will use them, and if the arguments are not
convincing then the 'rule' probably was not worth that much to start
with.

 Source File:http://localhost:2008/jquery.js
 Line: 1859, Column: 71
 Source Code:
});

 anonymous function does not always return a value
 Source File:http://localhost:2008/jquery.js
 Line: 3524, Column: 20
 Source Code:
 this[0][ method ];

 though this warning show, it does not affect my entire
 program.

No, everything should run just the same, though probably very
fractionally slower as it must take some time to recognise the
subjects of the warnings and make the reports of those warnings.

 i hope that all of you can make me understand about this
 or maybe solve this stuff.

There is nothing to solve, they are just warnings. It is errors that
you should worry about, and if the warnings start to get in the way of
seeing the errors filter the warnings out.


[jQuery] Re: jcarousel and ajax

2008-11-28 Thread Denes PAL

Hi,

when the page is loaded in the background (iframe, ajax) while using a
loader animation, the ready event triggered before the items has been
shown. So the jCarousel can not get the correct dimensions. The
solution is to init jcarousel after the content has been shown, by
explicitly call the init function, or specify a new onload type event
and catch it correctly.

ds

matt wrote:
 I have a site that uses jcarousel.  This works fine, but I also have
 links on the side, that when clicked, loads in new content via ajax
 (new page content and new carousel).  The problem is that jcarousel
 stopped working, using this message:

 jCarousel: No width/height set for items. This will cause an infinite
 loop. Aborting..

 Ok, so no problem, I'll just use livequery to fix the problem.  Well
 it added the images to the carousel, and started to cycle through, but
 I still got this message:

 jCarousel: No width/height set for items. This will cause an infinite
 loop. Aborting..

 Even when I'm loading in pages via ajax that do not have the ID that
 utilizes the jcarousel, I get the error message.  Anyone have any idea
 how to fix this?


[jQuery] code dosen't work if put after some other code

2008-11-28 Thread Betty

Hi, I'm new. I've written two pieces of code with jQuery. Each of them
works well individually. However, if I put them one after the other,
the first one still works, but the latter one will not work. If I
change their order, it's always the first that can work and the latter
one that can't work. Both pieces are quite simple, and I don't think
there is anything conflicting between them. To be more clear, the code
is something like this:

$(#button1).hover(function () {
  //do something
});
$(#button2).hover(function () {
  //do something else
});

No matter in which order I put the two, the second one just doesn't
work. I just don't understand. Is there a special rule to clear the
cache of function() or something? Any help will be much appreciated!


[jQuery] [superfish] submenu position: left or right

2008-11-28 Thread marco

hi! i got a menu with many nested sub-menus. some sub-menus get out of
the page width because they are all open on the right of the parent.
can superfish open menus on the left if there is not enough space on
the right?

thanks
marco


[jQuery] Re: code dosen't work if put after some other code

2008-11-28 Thread brian
I think you'll need to post the exact code you're having problems with.

On Fri, Nov 28, 2008 at 8:32 AM, Betty [EMAIL PROTECTED] wrote:


 Hi, I'm new. I've written two pieces of code with jQuery. Each of them
 works well individually. However, if I put them one after the other,
 the first one still works, but the latter one will not work. If I
 change their order, it's always the first that can work and the latter
 one that can't work. Both pieces are quite simple, and I don't think
 there is anything conflicting between them. To be more clear, the code
 is something like this:

 $(#button1).hover(function () {
  //do something
 });
 $(#button2).hover(function () {
  //do something else
 });

 No matter in which order I put the two, the second one just doesn't
 work. I just don't understand. Is there a special rule to clear the
 cache of function() or something? Any help will be much appreciated!



[jQuery] Re: [Cluetip] don't work

2008-11-28 Thread Karl Swedberg

are you getting any JavaScript errors?

--Karl


Karl Swedberg
www.englishrules.com
www.learningjquery.com




On Nov 28, 2008, at 4:41 AM, Zic Puce wrote:


Hello all,

I work with the framework phpmvc and code with the MVC architecture.
I want to insert a popup should recover in xml file some info.

So I try basically the example given Demo Cluetip by downloading  
the file. All examples walk locally.


Now I take the example code 1 basic tip from title in Default  
Style that I put in my file header.tpl.

Namely:

[code]
script src=../jquery-1.2.5.min.js type=text/javascript/ 
script script src=../jquery.hoverIntent.js type=text/ 
javascript/script

  script src=../jquery.cluetip.js type=text/javascript/script
  script src=demo.js type=text/javascript/script
  link rel=stylesheet href=../jquery.cluetip.css type=text/ 
css /

  link rel=stylesheet href=demo.css type=text/css /
[/code]

I am very careful to place the file and *. js *. css in the right  
folder.


After, I place the code in the body :
[code]
div id=container
 div id=examples
ol
 li
a class=title href=# title=This is the  
title|The first set of body content comes after the first delimiter  
in the title.|In this case, the delimiter is a pipe.Exemple/a

/li
/ol
/div
/div
[/code]

I do not modify anything in the *. js, or *. css.
But here I will not display correctly popup title contrary to the  
example locally. It appears as a classic title.


If I modify simply this line :
[code]
a class=title href=# title=This is the title|The first set of  
body content comes after the first delimiter in the title.|In this  
case, the delimiter is a pipe.Exemple/a

[/code]

by
[code]
a class=basic href=ajax.htm rel=ajax.htmExemple/a
[/code]

Now, it appears nothing et I place the ajax.html in the good folder.
I don't understand
What do I missing?

HELP, HELP
Thanks
Benoit





[jQuery] Executing multiple actions on the same selection

2008-11-28 Thread flycast

In some other languages I have had experience with one can use the
following pattern...

object [
.doThis()
.andThis()
.andAlsoThis()
]

Is there a way to do this with jQuery?

$(a){
.hide();
.addClass();
}

***Instead of ***
$(a).hide();
$(a).addClass();


[jQuery] Re: Executing multiple actions on the same selection

2008-11-28 Thread Charlie Griefer
yes.  jQuery supports method chaining.

$(a).hide().addClass();
see Chainability at http://docs.jquery.com/How_jQuery_Works

On Fri, Nov 28, 2008 at 12:26 PM, flycast [EMAIL PROTECTED] wrote:


 In some other languages I have had experience with one can use the
 following pattern...

 object [
 .doThis()
 .andThis()
 .andAlsoThis()
 ]

 Is there a way to do this with jQuery?

 $(a){
 .hide();
 .addClass();
 }

 ***Instead of ***
 $(a).hide();
 $(a).addClass();




-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] quote standards

2008-11-28 Thread seasoup

I've started using a single quote inside of all $() when quotes are
needed because it makes creating DOM elements much simpler. $('a
href=/path/a') or $('div id=anId/div and for consistency
doing $('#anId').   Anyone else doing the same thing?

Josh Powell


[jQuery] Re: quote standards

2008-11-28 Thread Andy Matthews

Yes. I am. Plus single quoting is slightly faster due to it's lower case
nature. No need to hold down the shift key. 

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of seasoup
Sent: Friday, November 28, 2008 2:47 PM
To: jQuery (English)
Subject: [jQuery] quote standards


I've started using a single quote inside of all $() when quotes are needed
because it makes creating DOM elements much simpler. $('a
href=/path/a') or $('div id=anId/div and for consistency
doing $('#anId').   Anyone else doing the same thing?

Josh Powell




[jQuery] Re: quote standards

2008-11-28 Thread Bill

I've wondered about this myself. I seem to go back and forth between
the two without any rhyme or reason. Looking forward to more responses
on this thread.

On Nov 28, 1:51 pm, Andy Matthews [EMAIL PROTECTED] wrote:
 Yes. I am. Plus single quoting is slightly faster due to it's lower case
 nature. No need to hold down the shift key.

 -Original Message-
 From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On

 Behalf Of seasoup
 Sent: Friday, November 28, 2008 2:47 PM
 To: jQuery (English)
 Subject: [jQuery] quote standards

 I've started using a single quote inside of all $() when quotes are needed
 because it makes creating DOM elements much simpler. $('a
 href=/path/a') or $('div id=anId/div and for consistency
 doing $('#anId').   Anyone else doing the same thing?

 Josh Powell


[jQuery] Re: quote standards

2008-11-28 Thread Charlie Griefer
i generally use single quotes unless i'm explicitly setting a string.
so..

var foo = the quick brown fox...;

but when inside of parentheses, i always wrap strings in single quotes.

On Fri, Nov 28, 2008 at 1:28 PM, Bill [EMAIL PROTECTED] wrote:


 I've wondered about this myself. I seem to go back and forth between
 the two without any rhyme or reason. Looking forward to more responses
 on this thread.

 On Nov 28, 1:51 pm, Andy Matthews [EMAIL PROTECTED] wrote:
  Yes. I am. Plus single quoting is slightly faster due to it's lower
 case
  nature. No need to hold down the shift key.
 
  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 
  Behalf Of seasoup
  Sent: Friday, November 28, 2008 2:47 PM
  To: jQuery (English)
  Subject: [jQuery] quote standards
 
  I've started using a single quote inside of all $() when quotes are
 needed
  because it makes creating DOM elements much simpler. $('a
  href=/path/a') or $('div id=anId/div and for consistency
  doing $('#anId').   Anyone else doing the same thing?
 
  Josh Powell




-- 
I have failed as much as I have succeeded. But I love my life. I love my
wife. And I wish you my kind of success.


[jQuery] Dynamic Event Handler

2008-11-28 Thread Ryan

I have some 'NAV' elements, that when clicked should slideToggle their
respective 'DATA' elements. I am trying to do this by traversing an
Object with a for loop, and each elements IDs are stored in this data
structure. However, once execute, each click of any of the NAV
elements only slideToggles the last DATA element.

Ex:

Code:

-- JAVASCRIPT
var categories = new Array();
categories[1] = new Object;
categories[1]['nav_id'] = 'NAV_1';
categories[1]['data_id'] = 'DATA_1';
categories[2] = new Object;
categories[2]['nav_id'] = 'NAV_2';
categories[2]['data_id'] = 'DATA_2';

-- JQUERY
for( var index in categories ){
  var nav_id= categories[ index ]['nav_id'];
  var data_id   = categories[ index ]['data_id'];

  $('#' + nav_id).click( function(){
$('#' + data_id).slideToggle('slow');
  }
   );
}

-- HTML
div id='NAV_1'
/div
div id='NAV_2'
/div

div id='DATA_1'
/div
div id='DATA_2'
/div
-- each div is absolutely positioned in the page



I could possible see that JQuery could get confused by this, but to me
should be able to work somehow. Could there possibly be a way to do a
foreach() through element id's that match a certain regular
expression?

Any help is greatly appreciated!


[jQuery] button is null

2008-11-28 Thread sergiomedinag

Hi!

I've just made a jQuery plugin that validates a form and shows a
tooltip to see the strings accepted for the field. Everything works
fine, except when I switch tabs in firefox+firebug I get an error
saying that button is null. It only shows that error when I use the
tooltip (When I comment the line where I attach the tooltip the error
is gone) . I guess that is some sort of events handling issues. Have
you ever get that error?

Thanks.


[jQuery] Re: quote standards

2008-11-28 Thread Michael Geary

I've posted messages here quite a few times recommending single quotes for
the very reason that Josh mentioned. If you use double quotes you have to
either escape the double quotes in HTML attributes, or use single quotes for
the HTML attributes (which is invalid although it does work), or switch to
single quotes for those strings. Easier to just use single quotes routinely.

-Mike
 
 From: Bill
 I've wondered about this myself. I seem to go back and forth 
 between the two without any rhyme or reason. Looking forward 
 to more responses on this thread.

  From: Andy Matthews
  Yes. I am. Plus single quoting is slightly faster due to its
  lower case nature. No need to hold down the shift key.

   From: Josh Powell
   I've started using a single quote inside of all $() when quotes
   are needed because it makes creating DOM elements much
   simpler. $('a href=/path/a') or
   $('div id=anId/div and for consistency
   doing $('#anId').   Anyone else doing the same thing?



[jQuery] Re: Form Editor like WUFOO.com with JQUERY??

2008-11-28 Thread eutelsat

Yes I know thanks but I think I need somenthing more, like for example
sorting and graphical selector and of course saving all this data and
interacting. I it is not supported then I need It to be easy to expand
to add the features.

On 28 nov, 16:00, Olivier Percebois-Garve [EMAIL PROTECTED]
wrote:
 jQuery itself has no drag and drop feature.
 That kind of interaction is within jQuery-ui which is built on top of
 jQuery.

 On Fri, Nov 28, 2008 at 3:17 PM, temega [EMAIL PROTECTED] wrote:

  jQuery has great Drag and Drop features

  On Nov 28, 10:27 am, eutelsat [EMAIL PROTECTED] wrote:
   Please can you help me to decide which tecnology is more appropiate?
   YUI, JQUERY or just another Library

   Hi I'm planning to develop something like a Form Editor in WUFOO with
   JQUERY.
   Needing Drag  Drop and object graphical selector moreover some custom
   code.

   Thanks in advance
   Jordi


[jQuery] Re: quote standards

2008-11-28 Thread Jeffrey Kretz

Same here.
JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of Michael Geary
Sent: Friday, November 28, 2008 2:20 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: quote standards


I've posted messages here quite a few times recommending single quotes for
the very reason that Josh mentioned. If you use double quotes you have to
either escape the double quotes in HTML attributes, or use single quotes for
the HTML attributes (which is invalid although it does work), or switch to
single quotes for those strings. Easier to just use single quotes routinely.

-Mike
 
 From: Bill
 I've wondered about this myself. I seem to go back and forth 
 between the two without any rhyme or reason. Looking forward 
 to more responses on this thread.

  From: Andy Matthews
  Yes. I am. Plus single quoting is slightly faster due to its
  lower case nature. No need to hold down the shift key.

   From: Josh Powell
   I've started using a single quote inside of all $() when quotes
   are needed because it makes creating DOM elements much
   simpler. $('a href=/path/a') or
   $('div id=anId/div and for consistency
   doing $('#anId').   Anyone else doing the same thing?




[jQuery] Re: button is null

2008-11-28 Thread seasoup

show us the code that generates the error.

On Nov 28, 1:53 pm, sergiomedinag [EMAIL PROTECTED] wrote:
 Hi!

 I've just made a jQuery plugin that validates a form and shows a
 tooltip to see the strings accepted for the field. Everything works
 fine, except when I switch tabs in firefox+firebug I get an error
 saying that button is null. It only shows that error when I use the
 tooltip (When I comment the line where I attach the tooltip the error
 is gone) . I guess that is some sort of events handling issues. Have
 you ever get that error?

 Thanks.


[jQuery] Re: how can i find() including self?

2008-11-28 Thread Dave Methvin

How about this?

$.fn.owns = function(selector) {
var owns = [];
this.filter('[aria-owns]').each(function(){

owns.push('#'+this.getAttribute('aria-owns').replace(/\s+/g,',#'));
});
return this.find('*').add(owns.join()).filter(selector);
};

Real children get precedence over the aria-owns stepchildren with this
approach. It seems to work for your situation but I don't know if
that's the right interpretation. Also, the selector is limited to the
simple selector used by filter(), basically that means no descendant
or child selectors can be in it.


[jQuery] Re: code dosen't work if put after some other code

2008-11-28 Thread Betty

Thank you, brian. Here is the script:

script type='text/javascript' src='http://ajax.googleapis.com/ajax/
libs/jquery/1.2.6/jquery.min.js?ver=1.2.6'/script
script type='text/javascript'
$(document).ready(function() {
$(.xtabber .tabcontentdiv).not(#tab1).hide();
$(.xtabber .tab a).hover(function () {
var xone = $(this).attr(href);
$(.xtabber .tabcontentdiv).not(xone).hide();
$(.xtabber .tabcontentdiv+xone).show();
});
$(.ytabber ul).not(#taba).hide();
$(.ytabber h3 a).hover(function () {
var yone = $(this).attr(href);
$(.ytabber ul).not(yone).slideUp(fast);
$(.ytabber ul+yone).slideDown(slow);
});
});
/script

And the html is:
div class=xtabber
div class=tab
h3a href=#tab1tab1/a/a href=#tab2tab2/a/a
href=#tab3tab3/a/h3
/div
div class=tabcontent
div id=tab1
ul
litab1 item1/li
litab1 item2/li
litab1 item3/li
/ul
/div
div id=tab2
ul
litab2 item1/li
litab2 item2/li
litab2 item3/li
/ul
/div !-- end of tab2 --
div id=tab3
ul
litab3 item1/li
litab3 item2/li
litab3 item3/li
/ul
/div !-- end of tab3 --
/div!-- end of tabcontent --
/div!-- end of xtabber --

div class=ytabber
div
h3a href=#tabataba/a/h3
ul id=taba
litaba item1/li
litaba item2/li
litaba item3/li
/ul
/div
div
h3a href=#tabbtabb/a/h3
ul id=tabb
litabb item1/li
litabb item2/li
litabb item3/li
/ul
/div
div
h3a href=#tabctabc/a/h3
ul id=tabc
litabc item1/li
litabc item2/li
litabc item3/li
/ul
/div
/div

The xtabber and ytabber part can work individually. But if I put them
together like this, only the first one works. Please help me. Thank
you very much!

On Nov 29, 3:05 am, brian [EMAIL PROTECTED] wrote:
 I think you'll need to post the exact code you're having problems with.



 On Fri, Nov 28, 2008 at 8:32 AM, Betty [EMAIL PROTECTED] wrote:

  Hi, I'm new. I've written two pieces of code with jQuery. Each of them
  works well individually. However, if I put them one after the other,
  the first one still works, but the latter one will not work. If I
  change their order, it's always the first that can work and the latter
  one that can't work. Both pieces are quite simple, and I don't think
  there is anything conflicting between them. To be more clear, the code
  is something like this:

  $(#button1).hover(function () {
   //do something
  });
  $(#button2).hover(function () {
   //do something else
  });

  No matter in which order I put the two, the second one just doesn't
  work. I just don't understand. Is there a special rule to clear the
  cache of function() or something? Any help will be much appreciated!


[jQuery] Re: Changing query parameter

2008-11-28 Thread pedalpete

I'm not sure what you bean about changing depending on 'where I'm
using the plugin'.

you could use an if statement to set the parameter to change.
for instance

[code]
if(q=='foo'){
var term=q;
}
if(term==null){
term=q;
}
[/code]

something like that I think, but you haven't really spelled out what
you are trying to do .

On Nov 28, 12:33 am, Osymandias [EMAIL PROTECTED] wrote:
 Hi all,

 Wondering how to change the actual query parameter sent by jquery at
 run time: e.g. instead of

 services?q=foo

 I might want to do

 services?term=foo,

 and this will change depending on where I'm using the plugin.


[jQuery] Re: code dosen't work if put after some other code

2008-11-28 Thread ricardobeat

hover() is meant to be passed two functions, one for mouseover and one
for mouseout: http://docs.jquery.com/Events/hover

However that doesn't explain why just the second one doesn't work...
see if using mouseover() or bind('mouseenter',fn) helps.

On Nov 29, 12:16 am, Betty [EMAIL PROTECTED] wrote:
 Thank you, brian. Here is the script:

 script type='text/javascript' src='http://ajax.googleapis.com/ajax/
 libs/jquery/1.2.6/jquery.min.js?ver=1.2.6'/script
 script type='text/javascript'
 $(document).ready(function() {
         $(.xtabber .tabcontentdiv).not(#tab1).hide();
         $(.xtabber .tab a).hover(function () {
                 var xone = $(this).attr(href);
                 $(.xtabber .tabcontentdiv).not(xone).hide();
                 $(.xtabber .tabcontentdiv+xone).show();
         });
         $(.ytabber ul).not(#taba).hide();
         $(.ytabber h3 a).hover(function () {
                 var yone = $(this).attr(href);
                 $(.ytabber ul).not(yone).slideUp(fast);
                 $(.ytabber ul+yone).slideDown(slow);
         });});

 /script

 And the html is:
 div class=xtabber
         div class=tab
                 h3a href=#tab1tab1/a/a href=#tab2tab2/a/a
 href=#tab3tab3/a/h3
         /div
         div class=tabcontent
         div id=tab1
                         ul
                         litab1 item1/li
                         litab1 item2/li
                         litab1 item3/li
                         /ul
         /div
         div id=tab2
                         ul
                                 litab2 item1/li
                                 litab2 item2/li
                                 litab2 item3/li
                         /ul
         /div !-- end of tab2 --
         div id=tab3
                         ul
                                 litab3 item1/li
                                 litab3 item2/li
                                 litab3 item3/li
                         /ul
         /div !-- end of tab3 --
         /div!-- end of tabcontent --
 /div!-- end of xtabber --

 div class=ytabber
         div
                 h3a href=#tabataba/a/h3
                 ul id=taba
                         litaba item1/li
                         litaba item2/li
                         litaba item3/li
                 /ul
         /div
         div
                 h3a href=#tabbtabb/a/h3
                 ul id=tabb
                         litabb item1/li
                         litabb item2/li
                         litabb item3/li
                 /ul
         /div
         div
                 h3a href=#tabctabc/a/h3
                 ul id=tabc
                         litabc item1/li
                         litabc item2/li
                         litabc item3/li
                 /ul
         /div
 /div

 The xtabber and ytabber part can work individually. But if I put them
 together like this, only the first one works. Please help me. Thank
 you very much!

 On Nov 29, 3:05 am, brian [EMAIL PROTECTED] wrote:

  I think you'll need to post the exact code you're having problems with.

  On Fri, Nov 28, 2008 at 8:32 AM, Betty [EMAIL PROTECTED] wrote:

   Hi, I'm new. I've written two pieces of code with jQuery. Each of them
   works well individually. However, if I put them one after the other,
   the first one still works, but the latter one will not work. If I
   change their order, it's always the first that can work and the latter
   one that can't work. Both pieces are quite simple, and I don't think
   there is anything conflicting between them. To be more clear, the code
   is something like this:

   $(#button1).hover(function () {
    //do something
   });
   $(#button2).hover(function () {
    //do something else
   });

   No matter in which order I put the two, the second one just doesn't
   work. I just don't understand. Is there a special rule to clear the
   cache of function() or something? Any help will be much appreciated!


[jQuery] Adding IMG attributes

2008-11-28 Thread enchance

I'm trying to add several attributes to all my img tags but I'm not
sure if they're both working. Could you verify if these are correct?

$(document).ready(function(){
//add the width and height for each image
$('img').each(function(){
   $(this).attr('width', $(this).width());
   $(this).attr('height', $(this).height());
});

//copy alt to title
$('img').attr('title', function(){
   $(this).attr('alt');
});
});

Am I doing the right thing?


[jQuery] Error while printing the JSON content after evaluating!!!!

2008-11-28 Thread aarti

Hi,

I am getting error while trying to print the content of json string.
My servlet is getting evaluated as it is alerting the next statement
immediately after eval line in the code.

0] alert(req.responseText);
1] doc_json = eval('('+ req.responseText+')');
2] alert(eval successful);
3] alert(doc_json.feed.channels[0].name);

It gives me alert upto 2] line as eval successful. Immediately after
that I am getting error as doc_json undefined.
I tested my json string, it is fine too.
Can anybody please tell me what could be the problem?

Thanks.


[jQuery] Re: Adding IMG attributes

2008-11-28 Thread Jeffrey Kretz

Not exactly.

The $(document).ready function fires when the DOM has been fully built, so
not all the images will be loaded at that time.

You could bind to the images load method as well.

function fixDimensions()
{
   var img = $(this);
   img.attr('width',img.width());
   img.attr('height',img.height());
}

$('img').each(fixDimensions).bind('load',fixDimensions);

JK

-Original Message-
From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
Behalf Of enchance
Sent: Friday, November 28, 2008 5:52 PM
To: jQuery (English)
Subject: [jQuery] Adding IMG attributes


I'm trying to add several attributes to all my img tags but I'm not
sure if they're both working. Could you verify if these are correct?

$(document).ready(function(){
//add the width and height for each image
$('img').each(function(){
   $(this).attr('width', $(this).width());
   $(this).attr('height', $(this).height());
});

//copy alt to title
$('img').attr('title', function(){
   $(this).attr('alt');
});
});

Am I doing the right thing?



[jQuery] Re: Appending text works; appending element doesn't

2008-11-28 Thread Rodent of Unusual Size

On Nov 25, 11:24 am, ricardobeat [EMAIL PROTECTED] wrote:
 Your code, exactly as it is, works perfectly for me. I didn't include
 the tablesorter plugin in my test.

Removing the tablesorter artifact (left over when I trimmed to a
minimum test case) had no effect.

Changing the document's IMT from 'application/xhtml+xml;charset=UTF-8'
to 'text/html' allowed it to work.  Changing the content type of my
documents isn't an option.

Can you verify that yours works with the XHTML content type?  Or not?

If not, this sounds like a bug, and I suspect it's either in jQuery
itself or in how jeditable is calling jQuery.  (I'm probably wrong,
but that's how it feels.)  If it *is* a bug (and not a 'not yet
supported feature') where should I log it?

Thanks!


[jQuery] Remove ellipsis from shortened title.

2008-11-28 Thread DemersDesigns

Hello,
I am using Simplepie and truncating fields that are longer than a
certain length. This process adds an ellipsis to the end, which I want
in most situations. However, for titles, I do not want the ellipsis to
show. I am trying to use jquery to remove the ellipsis character code
(hellip;) from any H3 tag that has it, but am having a real problem
getting it done. Here is what I have been working from with no luck.

script type=text/javascript
$(function(){
$(dt hellip;).remove();
});
/script


Thanks as always!
-Paul


[jQuery] Re: Error while printing the JSON content after evaluating!!!!

2008-11-28 Thread seasoup

Heya, happy to help.  I have a few questions though.

1) Can/do you use firebug and console.log, it provides more
information.

2) How come you are putting parenthesis around req.responseText?

3) Can you show us the req.responseText?

Thanks,
Josh Powell

On Nov 28, 5:31 pm, aarti [EMAIL PROTECTED] wrote:
 Hi,

 I am getting error while trying to print the content of json string.
 My servlet is getting evaluated as it is alerting the next statement
 immediately after eval line in the code.

 0] alert(req.responseText);
 1] doc_json = eval('('+ req.responseText+')');
 2] alert(eval successful);
 3] alert(doc_json.feed.channels[0].name);

 It gives me alert upto 2] line as eval successful. Immediately after
 that I am getting error as doc_json undefined.
 I tested my json string, it is fine too.
 Can anybody please tell me what could be the problem?

 Thanks.


[jQuery] jeditable tooltip for empty table cell becomes content

2008-11-28 Thread Rodent of Unusual Size

New demonstration case for another problem I've noticed with
jeditable:

http://apache.pastebin.ca/1270021

I'm making cells in a table editable, and passing jeditable a string
for the hover tooltip.  However, if the cell in question has no
content (e.g., td/td) jeditable stuffs the tooltip into the
element as its value.

Once again, am I doing something wrong, or is this a bug I should
report?

Thanks..


[jQuery] Re: Remove ellipsis from shortened title.

2008-11-28 Thread Leapfrog!





dt will be an object.
you could use _javascript_s replace() method

maybe..

$('dt').text().replace("hellip;", "");
.. i think

DemersDesigns wrote:

  Hello,
I am using Simplepie and truncating fields that are longer than a
certain length. This process adds an ellipsis to the end, which I want
in most situations. However, for titles, I do not want the ellipsis to
show. I am trying to use jquery to remove the ellipsis character code
(hellip;) from any H3 tag that has it, but am having a real problem
getting it done. Here is what I have been working from with no luck.

script type="text/_javascript_"
$(function(){
$("dt hellip;").remove();
});
/script


Thanks as always!
-Paul

  





[jQuery] Re: Remove ellipsis from shortened title.

2008-11-28 Thread brian
H3 tag, or DT?

Anyway, I'm pretty sure that remove is not what you want. I think you'd need
to do something like:

$('h3').each(function(){
var t = $(this).text();
$(this).text(t.replace(/hellip;/''/));
});

Obviously, replace h3 with whatever makes the most sense for your page.

On Fri, Nov 28, 2008 at 11:50 PM, DemersDesigns [EMAIL PROTECTED]wrote:


 Hello,
 I am using Simplepie and truncating fields that are longer than a
 certain length. This process adds an ellipsis to the end, which I want
 in most situations. However, for titles, I do not want the ellipsis to
 show. I am trying to use jquery to remove the ellipsis character code
 (hellip;) from any H3 tag that has it, but am having a real problem
 getting it done. Here is what I have been working from with no luck.

 script type=text/javascript
 $(function(){
 $(dt hellip;).remove();
 });
 /script


 Thanks as always!
 -Paul


[jQuery] Re: Remove ellipsis from shortened title.

2008-11-28 Thread Michael Geary

Your code is using hellip; as part of a selector, which won't do what you
want. It will probably end up selecting nothing. And jQuery's remove()
method removes entire DOM nodes. You don't want that; you just want to
remove part of the text.

Also, you mentioned H3 elements, but the selector has a DT in it. Which is
it?

The code to do what you describe could look something like this:

$(function(){
$('h3').each( function() {
var $h = $(this);
$h.html( $h.html().replace( 'hellip;', '' ) );
});
});

Or, breaking it down step by step to make it more clear:

$(function(){
$('h3').each( function() {  // loop through all H3 elements
var $h = $(this);  // get the current H3 has a jQuery object
var html = $h.html();  // get the HTML content of the element
html = html.replace( 'hellip;', '' );  // remove 'hellip;'
$h.html( html );  // store the HTML back in the element
});
});

-Mike

 From: DemersDesigns
 
 Hello,
 I am using Simplepie and truncating fields that are longer 
 than a certain length. This process adds an ellipsis to the 
 end, which I want in most situations. However, for titles, I 
 do not want the ellipsis to show. I am trying to use jquery 
 to remove the ellipsis character code
 (hellip;) from any H3 tag that has it, but am having a real 
 problem getting it done. Here is what I have been working 
 from with no luck.
 
 script type=text/javascript
 $(function(){
 $(dt hellip;).remove();
 });
 /script
 
 Thanks as always!
 -Paul



[jQuery] Re: Appending text works; appending element doesn't

2008-11-28 Thread brian
I can tell you that my experience also with an XHTML+XML MIME and JQuery was
full of pain.
Luckily, I had the option to change the Content-Type, as it was only there
for a legacy app. So,
I never bothered to investigate further whether or not it could work with
JQuery.

On Fri, Nov 28, 2008 at 11:37 PM, Rodent of Unusual Size [EMAIL PROTECTED]
 wrote:


 On Nov 25, 11:24 am, ricardobeat [EMAIL PROTECTED] wrote:
  Your code, exactly as it is, works perfectly for me. I didn't include
  the tablesorter plugin in my test.

 Removing the tablesorter artifact (left over when I trimmed to a
 minimum test case) had no effect.

 Changing the document's IMT from 'application/xhtml+xml;charset=UTF-8'
 to 'text/html' allowed it to work.  Changing the content type of my
 documents isn't an option.

 Can you verify that yours works with the XHTML content type?  Or not?

 If not, this sounds like a bug, and I suspect it's either in jQuery
 itself or in how jeditable is calling jQuery.  (I'm probably wrong,
 but that's how it feels.)  If it *is* a bug (and not a 'not yet
 supported feature') where should I log it?

 Thanks!


[jQuery] Re: code dosen't work if put after some other code

2008-11-28 Thread brian
As Ricardo said, hover() expects a second function. I just tested your code
and it works just fine
like this:

$(document).ready(function() {

   $(.xtabber .tabcontentdiv).not(#tab1).hide();
   $(.xtabber .tab a).hover(function () {
   var xone = $(this).attr(href);
   $(.xtabber .tabcontentdiv).not(xone).hide();
   $(.xtabber .tabcontentdiv+xone).show();
   }, function(){});

   $(.ytabber ul).not(#taba).hide();
   $(.ytabber h3 a).hover(function () {
   var yone = $(this).attr(href);
   $(.ytabber ul).not(yone).slideUp(fast);
   $(.ytabber ul+yone).slideDown(slow);
   }, function(){});
});

So, leaving out the second function causes some funny behaviour. I'd have
expected nothing to work.


On Fri, Nov 28, 2008 at 9:38 PM, ricardobeat [EMAIL PROTECTED] wrote:


 hover() is meant to be passed two functions, one for mouseover and one
 for mouseout: http://docs.jquery.com/Events/hover

 However that doesn't explain why just the second one doesn't work...
 see if using mouseover() or bind('mouseenter',fn) helps.

 On Nov 29, 12:16 am, Betty [EMAIL PROTECTED] wrote:
  Thank you, brian. Here is the script:
 
  script type='text/javascript' src='http://ajax.googleapis.com/ajax/
  libs/jquery/1.2.6/jquery.min.js?ver=1.2.6'/script
  script type='text/javascript'
  $(document).ready(function() {
  $(.xtabber .tabcontentdiv).not(#tab1).hide();
  $(.xtabber .tab a).hover(function () {
  var xone = $(this).attr(href);
  $(.xtabber .tabcontentdiv).not(xone).hide();
  $(.xtabber .tabcontentdiv+xone).show();
  });
  $(.ytabber ul).not(#taba).hide();
  $(.ytabber h3 a).hover(function () {
  var yone = $(this).attr(href);
  $(.ytabber ul).not(yone).slideUp(fast);
  $(.ytabber ul+yone).slideDown(slow);
  });});
 
  /script
 
  And the html is:
  div class=xtabber
  div class=tab
  h3a href=#tab1tab1/a/a href=#tab2tab2/a/a
  href=#tab3tab3/a/h3
  /div
  div class=tabcontent
  div id=tab1
  ul
  litab1 item1/li
  litab1 item2/li
  litab1 item3/li
  /ul
  /div
  div id=tab2
  ul
  litab2 item1/li
  litab2 item2/li
  litab2 item3/li
  /ul
  /div !-- end of tab2 --
  div id=tab3
  ul
  litab3 item1/li
  litab3 item2/li
  litab3 item3/li
  /ul
  /div !-- end of tab3 --
  /div!-- end of tabcontent --
  /div!-- end of xtabber --
 
  div class=ytabber
  div
  h3a href=#tabataba/a/h3
  ul id=taba
  litaba item1/li
  litaba item2/li
  litaba item3/li
  /ul
  /div
  div
  h3a href=#tabbtabb/a/h3
  ul id=tabb
  litabb item1/li
  litabb item2/li
  litabb item3/li
  /ul
  /div
  div
  h3a href=#tabctabc/a/h3
  ul id=tabc
  litabc item1/li
  litabc item2/li
  litabc item3/li
  /ul
  /div
  /div
 
  The xtabber and ytabber part can work individually. But if I put them
  together like this, only the first one works. Please help me. Thank
  you very much!
 
  On Nov 29, 3:05 am, brian [EMAIL PROTECTED] wrote:
 
   I think you'll need to post the exact code you're having problems with.
 
   On Fri, Nov 28, 2008 at 8:32 AM, Betty [EMAIL PROTECTED] wrote:
 
Hi, I'm new. I've written two pieces of code with jQuery. Each of
 them
works well individually. However, if I put them one after the other,
the first one still works, but the latter one will not work. If I
change their order, it's always the first that can work and the
 latter
one that can't work. Both pieces are quite simple, and I don't think
there is anything conflicting between them. To be more clear, the
 code
is something like this:
 
$(#button1).hover(function () {
 //do something
});
$(#button2).hover(function () {
 //do something else
});
 
No matter in which order I put the two, the second one just doesn't
work. I just don't understand. Is there a special rule to clear the
cache of function() or something? Any help will be much appreciated!



[jQuery] jQuery Countdown

2008-11-28 Thread ripcurlksm


I am trying to get the countdown to work from this example
(http://keith-wood.name/countdown.html), and I cant get it working.. What am
I doing wrong?



html
head
script type=text/javascript
src=http://code.jquery.com/jquery-latest.pack.js;/script
link rel=stylesheet type=text/css href=jquery.countdown.css /
script type=text/javascript src=jquery.countdown.js/script
script
var newYear = new Date(2009, 1-1, 1); 
$('#defaultCountdown').countdown({until: newYear}); 
 
$('#removeCountdown').toggle(function() { 
$(this).text('Re-attach'); 
$('#defaultCountdown').countdown('destroy'); 
}, 
function() { 
$(this).text('Remove'); 
$('#defaultCountdown').countdown({until: newYear}); 
} 
);
/script
/head
 
body
div id=defaultCountdown/div
/body
/html 

-- 
View this message in context: 
http://www.nabble.com/jQuery-Countdown-tp20744495s27240p20744495.html
Sent from the jQuery General Discussion mailing list archive at Nabble.com.