[jQuery] Re: does jquery 1.2.1 support xpath????

2007-11-25 Thread Gordon

I'm not sure but I believe that xpath might have been moved from the
core in 1.2 to a plugin, on the grounds that most people use CSS
selectors.

On Nov 24, 10:25 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 I find something strange in last release. Xpath expressions doesn't
 work
 For example

 var test1 = $('/html/body');
 alert(test1.length);

 always print 0


[jQuery] Re: fadeIn/Out problem

2007-11-25 Thread Wizzud

You might want to look into using the hoverIntent plugin ...
http://jquery.com/plugins/project/hoverIntent

On Nov 24, 9:46 pm, krcko [EMAIL PROTECTED] wrote:
 Hi to all, i'm having problems with fade in/out animation. I have
 buttons and i want to make hover fade-in effect.

 this is html:

 div class=button
 div class=button-base/div
 div class=button-hover/div
 a href=#Top rated/a
 /div

 div class=button
 div class=button-base/div
 div class=button-hover/div
 a href=#Groups/a
 /div

 at the beginning button-hover is hidden, and i want to make it fade-in
 when button is hovered, this is script i use:

 $(function()
 {
 $('.button').each(function()
 {
 $(this).hover
 (
 function()
 {
 $('.button-hover', this).fadeIn('fast');
 },

 function()
 {
 $('.button-hover', this).fadeOut('normal');
 }
 );
 });

 });

 and it works ok, but when i move mouse hover and out the button i.e.
 15 times the script will 'remember' that and it will flash button 15
 times! i don't want this.

 i've tried to add flag to each button $('.button').attr('animating',
 'no') and to check it before doing any animations, if the flag state
 is yes i return, if not i do animation, and i was setting this flag
 before fadeIn and fadeOut and reseting it in callback function for
 each animation... but it doesn't works...

 i've tried with .stop() function but had no luck either...


[jQuery] Re: :contains selector question

2007-11-25 Thread Benjamin Sterling
Karl,
That is what I expected get too, just needed to clarify.

If you just want to select table cells, why not do $('td:contains(Cell)') ?


I am doing an article on selectors and selector speeds and was experimenting
on what approach is faster[1] and when I got to this selector, I would have
expected the BODY and HTML be selected also, but since it did not, I started
to second guess myself.

I have a test page up at
http://benjaminsterling.com/articles/jQuery-%20Select%20what%20you%20want%20-%20part%201.htm

and if you hit the Test 10 toggle button, you will see that only the table
elements are getting the background color of #FF0 as well as the DIV that
the TABLE is wrapped in, leaving the  BODY, and HTML tags alone.  So would
you say this is a bug or something we should expect?

Thanks.

On 11/24/07, Karl Swedberg [EMAIL PROTECTED] wrote:

 Hey Benjamin,
 For :contains(), the matching text can appear in the selector element or
 in any of that element's descendants [1]. Since you don't precede :contains
 with a selector element, it assumes the universal selector (*). So, it looks
 like it's doing what I would expect. In fact, it should be selecting HTML,
 BODY, and any other elements that contain those cells.

 If you just want to select table cells, why not do $('td:contains(Cell)')
 ?

 [1] Had to look this up to be sure, even though I wrote it in jQuery
 Reference Guide, page 34. Sigh.

 --Karl
 _
 Karl Swedberg
 www.englishrules.com
 www.learningjquery.com



 On Nov 24, 2007, at 9:09 PM, Benjamin Sterling wrote:

 Hey guys,
 Wanted to make sure I am getting the correct returned elements.

 Assume I have a table like:
 table cellpadding=3 cellspacing=0 border=1 width=100%
 tbody
 tr
 tdCell 1/td
 tdCell 2/td
 tdCell 3/td
 tdCell 4/td
 td/td
 tdCell 6/td
 /tr
 /tbody
 /table

 And then I run a piece a code like:

 $(:contains('Cell')).css(background, #ff0);

 In my mind, I should only be getting back the TDs with Cell in it, but
 this is not the case.  the TABLE, TBODY, TR and TD are all getting a
 background collor of FF0.

 Am I correct in what I think I should be getting back?

 Thanks.

 --
 Benjamin Sterling
 http://www.KenzoMedia.com
 http://www.KenzoHosting.com
 http://www.benjaminsterling.com





-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com


[jQuery] Re: IE Help.

2007-11-25 Thread Benjamin Sterling
Austin,
Do you have a test case for us to look at?  Also, you can test for most
issue in Opera since they are using the same javascript engine as ie7, I am
finding this to be a huge help.

On 11/24/07, bingo [EMAIL PROTECTED] wrote:


 hi Austin,

 I am not sure what's the problem..but make sure you are not making any
 of these mistakes (listed in the blog)

 http://ragrawal.wordpress.com/2007/10/25/top-5-reasons-why-ie7-is-complaining-about-your-javascript/

 Regards

 On Nov 24, 3:52 pm, Austin Pickett [EMAIL PROTECTED] wrote:
  Are there any ie hacks or maybe some ie tricks with jquery?
  Ie's being stubborn with me and whenever i try to make a simple slider
 
  click x { show y }
 
  type of thing it doesn't even work.
 
  Does anyone else have trouble with IE and Jquery?




-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com


[jQuery] Re: LiveQuery (Discuss Please)

2007-11-25 Thread nathandh

 Obviously, that was only a simple example. The more general case, wanting to
 bind some event handler to a selector regardless of when it appears on the
 page, is extremely common. So again, I'm trying to understand why the rate
 of adoption has been so slow. Any thoughts?

I've been using jQuery for about a year, but this is the first I've
heard of livequery.  I found it today because I ran into an obstacle
in an application I'm developing for the first time that it solves
nicely; now I expect to use it frequently (though I don't do much
AJAX, admittedly).

I think if it came down to a vote, this seems central enough to me to
warrant including in the core, though I'm sure there are many other
folks who think many hundreds of other plug-ins are likewise good
candidates.  Is adoption rate the principal consideration for
inclusion?  Seems the best resolution is to decide on clear
criteria...

I suppose as long as it's possible to do this via 'bind' with the core
-- even if inelegant -- it may be wiser to leave it as a plugin, the
better to preserve jQuery's leanness.  That's a more important
consideration, by far, and one of the reasons I bailed from both
Prototype and Mootools...

Cheers,
Nathan


[jQuery] Re: IE Help.

2007-11-25 Thread Austin Pickett

Hrm, Thanks for the link, I gave it a try didn't help me much, but
essentially this is the only problems I encounter:

$(document).ready(function() {
  $('.show_comments').click(function(){
$('#showdiv').slideToggle('fast');
  });
});

Is the code, and it works fine in FF however in IE 6.0, it's just
shown and when I click to toggle the hide/show div it doesn't work.
Maybe another set of eyes could help me with this since I'm quite new
at JQuery let alone JavaScript.


On Nov 24, 7:33 pm, bingo [EMAIL PROTECTED] wrote:
 hi Austin,

 I am not sure what's the problem..but make sure you are not making any
 of these mistakes (listed in the 
 blog)http://ragrawal.wordpress.com/2007/10/25/top-5-reasons-why-ie7-is-com...

 Regards

 On Nov 24, 3:52 pm, Austin Pickett [EMAIL PROTECTED] wrote:

  Are there any ie hacks or maybe some ie tricks with jquery?
  Ie's being stubborn with me and whenever i try to make a simple slider

  click x { show y }

  type of thing it doesn't even work.

  Does anyone else have trouble with IE and Jquery?


[jQuery] Re: jQuery Form Plugin document.myform.submit()

2007-11-25 Thread Geoff Millikan

How interesting, the form submits, and the AJAX is returned (I can see
it in FireBug) but not in the DIV tags.  It appears that using a
function to submit the form breaks the  jQuery Form Plugin.

Example at the below link.  Click on the dial up button to submit
the form.

http://mammoth.t1shopper.com/voip/ajaxform.html


[jQuery] Re: Styling left hand column of table.

2007-11-25 Thread jonhobbs

HI Karl,

That is exactly the answer i was looking for.

Thank You

On Nov 24, 5:49 pm, Karl Swedberg [EMAIL PROTECTED] wrote:
 Hi Jon,

 You're almost there! What you want is to add a class to every td that
 is the first child of its parent. Using td:first will select only the
 very first td. You need td:first-child ! So, this line ...

  $(.Grid tbody tr td:first).removeClass(GridMiddleCell);

 should change to this ...

 $(.Grid tbody tr td:first-
 child).removeClass(GridMiddleCell).addClass(GridLeftCell);

 If you only have three columns, you can add classes to each column's
 cells like so:

 var $cells = $(.Grid tbody tr td);

 $cells.filter(:first-child).addClass(GridLeftCell);
 $cells.filter(:nth-child(2)).addClass(GridMiddleCell);
 $cells.filter(:nth-child(3)).addClass(GridRightCell);

 Hope that helps.

 --Karl

 _
 Karl Swedbergwww.englishrules.comwww.learningjquery.com

 On Nov 24, 2007, at 9:25 AM, jonhobbs wrote:



  Hi,

  I've just read the Jquery book and though I understood a bit about
  selectors, turned out I was wrong!

  I am trying style every cell in a table but style the left and right
  most colums differently.

  I start with three classes

  GridLeftCell
  GridMiddleCell
  GridRightCell

  ... and I style every cell with  GridCellMiddle

  I then try to replace the class on all cells in the first column by
  doing the following..

  $(document).ready(function(){

 $(.Grid tbody td).addClass(GridMiddleCell);

 $(.Grid tbody tr td:first).removeClass(GridMiddleCell);
  -
   });

  I thought this would drill down to each TR and select the first TD in
  eact TR, but it is only affecting the first cell in the first row.

  Anybody know what selector I am supposed to be using ?

  Thanks, Jon


[jQuery] jQuery Form Plugin Doesn't execute on returned forms?

2007-11-25 Thread Geoff Millikan

I have a form that is submitted via the jQuery Form Plugin to a PHP
page which then returns another form in its place.  The second form
looks identical to the first however this second form will not submit
via the jQuery Form Plugin.

It's as if the jQuery Form Plugin script at the top of the original
page doesn't exist.

Do I have to somehow reinitialize the jQuery Form Plugin to recognize
the returned form?

http://mammoth.t1shopper.com/voip/ajaxform.html


[jQuery] Re: problems about jquery.validate

2007-11-25 Thread Jacky

Hi Jörn,

thanks your reply and great works.


On 11月25日, 上午3时01分, Jörn Zaefferer [EMAIL PROTECTED] wrote:
 Hi Jack! can jquery.validate use custom validator? And another problem is 
 about
  email validator,it can't pass validate with my email address
  [EMAIL PROTECTED] exactly validate email address.

 Yes, custom validations are possible. Take a look at this and let me
 know if that doesn't help 
 you:http://jquery.bassistance.de/api-browser/plugins.html#jQueryvalidator...

 I've just added your example mail address to the testsuite and fixed the
 email validation accordingly. You can get that fixed revision 
 here:http://dev.jquery.com/view/trunk/plugins/validate/jquery.validate.js

 Regards
 Jörn


[jQuery] Re: IE Help.

2007-11-25 Thread Austin Pickett

Thanks for the link, I checked it out however what they gave had no
effect on me :\
Alright, I'll post the code of which I'm actually working with.

$(document).ready(function() {
  $('.show_comments').click(function(){
$('#showdiv').slideToggle('fast');
  });
});

That's all it is, I can't seem to see anything wrong with it; when I
go into FF it works fine, but in IE 6.0 it shows the comments box
shown and the option to show / hide the comments does not work. I'm
rather new to the JQuery language let alone the JavaScript language so
maybe someone could see something I don't?


On Nov 24, 7:33 pm, bingo [EMAIL PROTECTED] wrote:
 hi Austin,

 I am not sure what's the problem..but make sure you are not making any
 of these mistakes (listed in the 
 blog)http://ragrawal.wordpress.com/2007/10/25/top-5-reasons-why-ie7-is-com...

 Regards

 On Nov 24, 3:52 pm, Austin Pickett [EMAIL PROTECTED] wrote:

  Are there any ie hacks or maybe some ie tricks with jquery?
  Ie's being stubborn with me and whenever i try to make a simple slider

  click x { show y }

  type of thing it doesn't even work.

 Does anyone else have trouble with IE and Jquery?


[jQuery] Re: jQuery Form Plugin document.myform.submit()

2007-11-25 Thread Mike Alsup

You should not be using ajaxSubmit and ajaxForm together.  Pick one or
the other.  In your case you should drop ajaxForm and use ajaxSubmit
like this:

function submitme() {
$('#wizard1').ajaxSubmit({
target: '#output1'
});
return false;
}


Mike


On Nov 24, 2007 11:50 PM, Geoff Millikan [EMAIL PROTECTED] wrote:

 How interesting, the form submits, and the AJAX is returned (I can see
 it in FireBug) but not in the DIV tags.  It appears that using a
 function to submit the form breaks the  jQuery Form Plugin.

 Example at the below link.  Click on the dial up button to submit
 the form.

 http://mammoth.t1shopper.com/voip/ajaxform.html



[jQuery] Re: jQuery Form Plugin Doesn't execute on returned forms?

2007-11-25 Thread Mike Alsup

 Do I have to somehow reinitialize the jQuery Form Plugin to recognize
 the returned form?

Sort of, but the other way around.  You need to bind the new form
after it is inserted into the DOM.


[jQuery] Re: :contains selector question

2007-11-25 Thread Karl Swedberg


On Nov 25, 2007, at 9:08 AM, Benjamin Sterling wrote:


Karl,
That is what I expected get too, just needed to clarify.

If you just want to select table cells, why not do $ 
('td:contains(Cell)') ?


I am doing an article on selectors and selector speeds and was  
experimenting on what approach is faster[1] and when I got to this  
selector, I would have expected the BODY and HTML be selected also,  
but since it did not, I started to second guess myself.


I have a test page up at 
http://benjaminsterling.com/articles/jQuery-%20Select%20what%20you%20want%20-%20part%201.htm

and if you hit the Test 10 toggle button, you will see that only  
the table elements are getting the background color of #FF0 as well  
as the DIV that the TABLE is wrapped in, leaving the  BODY, and HTML  
tags alone.  So would you say this is a bug or something we should  
expect?


Nah, I'd say it's doing exactly what your selector is asking it to  
do. :-) The test 10 toggle button looks for all elements with  
:contains('Cell') within the context of all elements with  
class=theDiv. That's why the html and body tags aren't being included.


from your script:


$(:contains('Cell'), .theDiv).css(background, #ff0);


Try it without the contextual selector, and you'll see that everything  
turns yellow:


$(:contains('Cell')).css(background, #ff0)

Cheers,

Karl



[jQuery] Re: AJAX memory leak

2007-11-25 Thread Eric Teubert

Well .. I found out this happens even without jQuery, one _has to_
refresh the website to clear the RAM.

Eric


[jQuery] Re: :contains selector question

2007-11-25 Thread Benjamin Sterling
I knew that Karl, just seeing if you were paying attention. ;)

I totally forgot I was doing that, guess that is what I get when trying to
code with very little sleep.  Thanks.

On 11/25/07, Karl Swedberg [EMAIL PROTECTED] wrote:


 On Nov 25, 2007, at 9:08 AM, Benjamin Sterling wrote:

 Karl,
 That is what I expected get too, just needed to clarify.

 If you just want to select table cells, why not do $('td:contains(Cell)')
  ?
 

 I am doing an article on selectors and selector speeds and was
 experimenting on what approach is faster[1] and when I got to this selector,
 I would have expected the BODY and HTML be selected also, but since it did
 not, I started to second guess myself.

 I have a test page up at 
 http://benjaminsterling.com/articles/jQuery-%20Select%20what%20you%20want%20-%20part%201.htm


 and if you hit the Test 10 toggle button, you will see that only the
 table elements are getting the background color of #FF0 as well as the DIV
 that the TABLE is wrapped in, leaving the  BODY, and HTML tags alone.  So
 would you say this is a bug or something we should expect?


 Nah, I'd say it's doing exactly what your selector is asking it to do. :-)
 The test 10 toggle button looks for all elements with :contains('Cell')
 within the context of all elements with class=theDiv. That's why the html
 and body tags aren't being included.
 from your script:

 $(:contains('Cell'), .theDiv).css(background, #ff0);


 Try it without the contextual selector, and you'll see that everything
 turns yellow:

 $(:contains('Cell')).css(background, #ff0)

 Cheers,

 Karl




-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com


[jQuery] Re: :contains selector question

2007-11-25 Thread Karl Swedberg

Hehe. Glad you're awake now. :-)


--Karl

On Nov 25, 2007, at 11:04 AM, Benjamin Sterling wrote:


I knew that Karl, just seeing if you were paying attention. ;)

I totally forgot I was doing that, guess that is what I get when  
trying to code with very little sleep.  Thanks.


On 11/25/07, Karl Swedberg [EMAIL PROTECTED] wrote:

On Nov 25, 2007, at 9:08 AM, Benjamin Sterling wrote:


Karl,
That is what I expected get too, just needed to clarify.

If you just want to select table cells, why not do $ 
('td:contains(Cell)') ?


I am doing an article on selectors and selector speeds and was  
experimenting on what approach is faster[1] and when I got to this  
selector, I would have expected the BODY and HTML be selected also,  
but since it did not, I started to second guess myself.


I have a test page up at 
http://benjaminsterling.com/articles/jQuery-%20Select%20what%20you%20want%20-%20part%201.htm

and if you hit the Test 10 toggle button, you will see that only  
the table elements are getting the background color of #FF0 as well  
as the DIV that the TABLE is wrapped in, leaving the  BODY, and  
HTML tags alone.  So would you say this is a bug or something we  
should expect?


Nah, I'd say it's doing exactly what your selector is asking it to  
do. :-) The test 10 toggle button looks for all elements with  
:contains('Cell') within the context of all elements with  
class=theDiv. That's why the html and body tags aren't being  
included.


from your script:


$(:contains('Cell'), .theDiv).css(background, #ff0);


Try it without the contextual selector, and you'll see that  
everything turns yellow:


$(:contains('Cell')).css(background, #ff0)

Cheers,

Karl




--
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com




[jQuery] Re: jQuery Form Plugin Doesn't execute on returned forms?

2007-11-25 Thread Karl Swedberg


On Nov 25, 2007, at 10:22 AM, Mike Alsup wrote:




Do I have to somehow reinitialize the jQuery Form Plugin to recognize
the returned form?


Sort of, but the other way around.  You need to bind the new form
after it is inserted into the DOM.


Hi Geoff,

See this FAQ item for more details:

http://docs.jquery.com/Frequently_Asked_Questions#Why_do_my_events_stop_working_after_an_Ajax_request.3F


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



[jQuery] == onload function with the fadeIn effect. How? ==

2007-11-25 Thread Monkeytail

== Desired result:
I want a html file to be loaded into a div element. When the file is
injected, I want it to fade in.

== Problem:
I am a rookie when it comes to jQ (and js). I can't figure out how to
extend the onload function with the fadeIn effect.

== This is my jQ code:
$(document).ready(function() {

$(p a) . click(function() {
$(#text-to-show) . load(text_to_show.htm);
});
});

== Thanx


[jQuery] Re: fadeIn/Out problem

2007-11-25 Thread krcko

i've missed that one, thank you! you saved me lot of gray hairs :)

On Nov 25, 12:24 pm, Wizzud [EMAIL PROTECTED] wrote:
 You might want to look into using the hoverIntent plugin 
 ...http://jquery.com/plugins/project/hoverIntent

 On Nov 24, 9:46 pm, krcko [EMAIL PROTECTED] wrote:

  Hi to all, i'm having problems with fade in/out animation. I have
  buttons and i want to make hover fade-in effect.

  this is html:

  div class=button
  div class=button-base/div
  div class=button-hover/div
  a href=#Top rated/a
  /div

  div class=button
  div class=button-base/div
  div class=button-hover/div
  a href=#Groups/a
  /div

  at the beginning button-hover is hidden, and i want to make it fade-in
  when button is hovered, this is script i use:

  $(function()
  {
  $('.button').each(function()
  {
  $(this).hover
  (
  function()
  {
  $('.button-hover', this).fadeIn('fast');
  },

  function()
  {
  $('.button-hover', this).fadeOut('normal');
  }
  );
  });

  });

  and it works ok, but when i move mouse hover and out the button i.e.
  15 times the script will 'remember' that and it will flash button 15
  times! i don't want this.

  i've tried to add flag to each button $('.button').attr('animating',
  'no') and to check it before doing any animations, if the flag state
  is yes i return, if not i do animation, and i was setting this flag
  before fadeIn and fadeOut and reseting it in callback function for
  each animation... but it doesn't works...

  i've tried with .stop() function but had no luck either...


[jQuery] Re: == onload function with the fadeIn effect. How? ==

2007-11-25 Thread Benjamin Sterling
 $(#text-to-show) . load(text_to_show.htm, function(){
// the callback when the htm file is loaded
$(this).fadeIn();
});

That should do you; note: you may need to give #text-to-show a style of
display:none to start out.

On 11/25/07, Monkeytail [EMAIL PROTECTED] wrote:


 == Desired result:
 I want a html file to be loaded into a div element. When the file is
 injected, I want it to fade in.

 == Problem:
 I am a rookie when it comes to jQ (and js). I can't figure out how to
 extend the onload function with the fadeIn effect.

 == This is my jQ code:
 $(document).ready(function() {

 $(p a) . click(function() {
 $(#text-to-show) . load(text_to_show.htm);
 });
 });

 == Thanx




-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com


[jQuery] Re: fadeIn/Out problem

2007-11-25 Thread Brian Cherne
It appears my web site is down (at least for me). I added a release zip
file to the jquery plug-in page for hoverIntent, but it's not showing up now
that I've logged out (not sure what's going on with that). Let me know if
you need the code for hoverIntent... I'll send you a zip file.

Brian.

On 11/25/07, krcko [EMAIL PROTECTED] wrote:


 i've missed that one, thank you! you saved me lot of gray hairs :)

 On Nov 25, 12:24 pm, Wizzud [EMAIL PROTECTED] wrote:
  You might want to look into using the hoverIntent plugin
 ...http://jquery.com/plugins/project/hoverIntent
 
  On Nov 24, 9:46 pm, krcko [EMAIL PROTECTED] wrote:
 
   Hi to all, i'm having problems with fade in/out animation. I have
   buttons and i want to make hover fade-in effect.
 
   this is html:
 
   div class=button
   div class=button-base/div
   div class=button-hover/div
   a href=#Top rated/a
   /div
 
   div class=button
   div class=button-base/div
   div class=button-hover/div
   a href=#Groups/a
   /div
 
   at the beginning button-hover is hidden, and i want to make it fade-in
   when button is hovered, this is script i use:
 
   $(function()
   {
   $('.button').each(function()
   {
   $(this).hover
   (
   function()
   {
   $('.button-hover',
 this).fadeIn('fast');
   },
 
   function()
   {
   $('.button-hover',
 this).fadeOut('normal');
   }
   );
   });
 
   });
 
   and it works ok, but when i move mouse hover and out the button i.e.
   15 times the script will 'remember' that and it will flash button 15
   times! i don't want this.
 
   i've tried to add flag to each button $('.button').attr('animating',
   'no') and to check it before doing any animations, if the flag state
   is yes i return, if not i do animation, and i was setting this flag
   before fadeIn and fadeOut and reseting it in callback function for
   each animation... but it doesn't works...
 
   i've tried with .stop() function but had no luck either...



[jQuery] jeditable - issue dynamically resetting submitdata

2007-11-25 Thread spherop


I am using jeditable plug and it's working well but i am stuck with something
i need to do.

basically, i need to dynamically update the submitdata attribute of various
editable text inputs according to events happening on the client.
specifically, the user clicks on different thumbnails, and then can edit in
place different properties of the image (such as description, url etc). when
the thumbs are clicked i used .html() to load the new content in the various
editable inputs. then i try to reset the .editable attributes. I seem to be
able to update various attributes but for some reason, I cannot update the
submitdata attribute which i use to identify the rowid for the ajax call.
The code below is just an example to show/test the issue. Notice the postid
field of the submitdata is 64, then 61 in the second statement. And the
tooltip is 'blue', then 'red'. If i run the code, the tooltip will show up
'red' as i would expect. but the postid name/value pair sent to
ajaxaction.php will remain 64, not 61 as I would expect. For whatever
reason, once the submitdata is set, it seems it cannot be dynamically
changed. Maybe it's adding name/value pairs so it ends up with more than one
version of postid? I don't know ..but i cannot seem to get to the bottom. i
may not get something real basic...am new to jquery - so help appreciated
very much.

any ideas?

 $(.artistedit).editable(ajaxaction.php, { 
 id   : 'id',
 submitdata : {postid : 64, action : updatepostartist},
 name : 'newartist', 
 tooltip : 'blue'
 });
  $(.artistedit).editable(ajaxaction.php, { 
 id   : 'id',
 submitdata : {postid : 61, action : updatepostartist},
 name : 'newartist',
 tooltip : 'red'
 });  
-- 
View this message in context: 
http://www.nabble.com/jeditable---issue-dynamically-resetting-submitdata-tf4871410s27240.html#a13939161
Sent from the jQuery General Discussion mailing list archive at Nabble.com.



[jQuery] Re: Problem with jquery toggler conflicting with another jquery script

2007-11-25 Thread Benjamin Sterling
Rick,
Looks like you can get that menu from
http://youngpup.net/projects/transmenus/

On 11/24/07, Rick Faircloth [EMAIL PROTECTED] wrote:


 Hi, Robert (is it Robert?)
 (Seems a little strange to say hi to quik3r...but, whatever...)

 Anyway, I'm sorry I don't know enough about JS or jQuery to answer
 your question (I'm new to it all, too), but I do like the transparent,
 drop-down menu on the Verrico Associates site.  I've been thinking
 about using something like that.

 Is that from a jQuery plug-in?  Or straight JS?

 Or do you (or anyone else) know of a jQuery plug-in that will create
 semi-transparent drop-down menus?

 Rick



  -Original Message-
  From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On
 Behalf Of qwik3r
  Sent: Saturday, November 24, 2007 5:00 PM
  To: jQuery (English)
  Subject: [jQuery] Problem with jquery toggler conflicting with another
 jquery script
 
 
  Hello, I must be up front and say that I know very little about JS. I
  only know enough to basically implement it and follow instructions and
  sometimes diagnose problems, but this time not being one of them.
 
  This is an issue of a jquery toggler not working in IE6 vs FF.I have a
  few other jquery scripts on the site as well, one for smooth scroll
  and one for lightbox.
 
  On my site www.robertngordon.com/web if you scroll down to the
  description of the projects (under the large picture) you will see a
  'read more...' link in FF which exposes a hidden block of text after
  clicking, but you won't see it in IE6. That is the problem.
 
  I have discovered that it is a conflict between the lightbox js file
  that I have and one of the 3 other jquery related javascript files
  that I am using, and I have no idea how to really diagnose it. One
  might say why not just use another lightbox file, well there has been
  alot of chopping of this lightbox file to work with flickr, but that
  isn't the problem, I tested it and checked, even adding the original
  back and still had the same problem (pre messing with the code).
 
  Any help to resolve this would be appreciated, thanks.





-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com
http://www.benjaminsterling.com


[jQuery] document.getElementById('elid') != $('#elid') ?

2007-11-25 Thread kitsched

I was trying to populate a select's options when I noticed that I can
use:

sel = document.getElementById('product_id_01');
sel.options.length = 0;

but I can't use:

sel = $('#product_id_01');
sel.options.length = 0;

If anyone could provide a short explanation I'd be really grateful.

Thank you.


[jQuery] Form question

2007-11-25 Thread nathandh

Hello,

I'm working on a user profile page that has fields for shipping
address and billing address, with a checkbox that says, Same as
shipping?  You know the kind... where instead of filling out the
billing address, it autopopulates from the shipping fields you just
filled out.

What would be the simplest way to do this?  That is, to grab the
values from the shipping fields, populate the billing fields, then
disable them?

Thanks,
Nathan


[jQuery] Re: does jquery 1.2.1 support xpath????

2007-11-25 Thread Steve Clason

Gordon wrote:
 I'm not sure but I believe that xpath might have been moved from the
 core in 1.2 to a plugin, on the grounds that most people use CSS
 selectors.
 

Is true. http://docs.jquery.com/Release:jQuery_1.2

-- 
Steve Clason
Boulder, Colorado, USA
(303) 818-8590


[jQuery] close clueTip by selecting element in clueTip box

2007-11-25 Thread Tim

i am using clueTip with ajax to grab a list from a db.  i would like
the clueTip to close when the user selects an item from the list.  i'm
guessing there is an easy way to do this, but i've tried for a while
now without any success.  i tried calling cluetipClose() with the
onclick event, but since the clueTip is a separate web page, it is
saying that cluetipClose() is not defined.  any ideas?  thanks.


[jQuery] Re: == onload function with the fadeIn effect. How? ==

2007-11-25 Thread nathandh

 == Desired result:
 I want a html file to be loaded into a div element. When the file is
 injected, I want it to fade in.


Also, if you want to bind events/handlers to any elements in the html
file you've just loaded, check out the livequery plugin:

a href=http://brandonaaron.net/docs/livequery/;Livequery/a

If the elements are introduced into the page after the DOM has
finished loading, your events won't work, but this plugin takes care
of that for you.  Just used it and it's marvelous.


[jQuery] Re: fadeIn/Out problem

2007-11-25 Thread krcko

yeap, your site is down, but i've found hoverIntent.js in jquery's SVN
repository (i think jquery ui use it, but not sure, i've used windows'
search, and didn't browse the sources).

great plug-in, thanks!


[jQuery] Re: Problem with jquery toggler conflicting with another jquery script

2007-11-25 Thread Rick Faircloth
Thanks, Benjamin.

 

Rick

 

From: jquery-en@googlegroups.com [mailto:[EMAIL PROTECTED] On Behalf Of 
Benjamin Sterling
Sent: Sunday, November 25, 2007 2:57 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Re: Problem with jquery toggler conflicting with another 
jquery script

 

Rick,
Looks like you can get that menu from http://youngpup.net/projects/transmenus/

On 11/24/07, Rick Faircloth [EMAIL PROTECTED] wrote:


Hi, Robert (is it Robert?)
(Seems a little strange to say hi to quik3r...but, whatever...)

Anyway, I'm sorry I don't know enough about JS or jQuery to answer
your question (I'm new to it all, too), but I do like the transparent, 
drop-down menu on the Verrico Associates site.  I've been thinking
about using something like that.

Is that from a jQuery plug-in?  Or straight JS?

Or do you (or anyone else) know of a jQuery plug-in that will create 
semi-transparent drop-down menus?

Rick



 -Original Message-
 From: jquery-en@googlegroups.com [mailto: jquery-en@googlegroups.com
mailto:jquery-en@googlegroups.com ] On Behalf Of qwik3r
 Sent: Saturday, November 24, 2007 5:00 PM
 To: jQuery (English)
 Subject: [jQuery] Problem with jquery toggler conflicting with another jquery 
 script 


 Hello, I must be up front and say that I know very little about JS. I
 only know enough to basically implement it and follow instructions and
 sometimes diagnose problems, but this time not being one of them. 

 This is an issue of a jquery toggler not working in IE6 vs FF.I have a
 few other jquery scripts on the site as well, one for smooth scroll
 and one for lightbox.

 On my site www.robertngordon.com/web if you scroll down to the
 description of the projects (under the large picture) you will see a
 'read more...' link in FF which exposes a hidden block of text after 
 clicking, but you won't see it in IE6. That is the problem.

 I have discovered that it is a conflict between the lightbox js file
 that I have and one of the 3 other jquery related javascript files 
 that I am using, and I have no idea how to really diagnose it. One
 might say why not just use another lightbox file, well there has been
 alot of chopping of this lightbox file to work with flickr, but that 
 isn't the problem, I tested it and checked, even adding the original
 back and still had the same problem (pre messing with the code).

 Any help to resolve this would be appreciated, thanks. 






-- 
Benjamin Sterling
http://www.KenzoMedia.com
http://www.KenzoHosting.com 
http://www.benjaminsterling.com 



[jQuery] Re: document.getElementById('elid') != $('#elid') ?

2007-11-25 Thread Karl Rudd

The jQuery $ function returns a wrapper type object, which acts
like an array, even if there's only one object in it.

So you can do:

sel = $('#product_id_01');
sel[0].options.length = 0;

Karl Rudd

On Nov 26, 2007 6:33 AM, kitsched [EMAIL PROTECTED] wrote:

 I was trying to populate a select's options when I noticed that I can
 use:

 sel = document.getElementById('product_id_01');
 sel.options.length = 0;

 but I can't use:

 sel = $('#product_id_01');
 sel.options.length = 0;

 If anyone could provide a short explanation I'd be really grateful.

 Thank you.



[jQuery] jQuery minified size could be wrong?

2007-11-25 Thread Web Specialist
jQuery page allows us to download jQuery minified and Gzipped with
14.1kbusing this link:

http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.min.js

But after download it that plugin haves 46kb.

John, what's wrong?

Cheers

Marco Antonio


[jQuery] Re: close clueTip by selecting element in clueTip box

2007-11-25 Thread Karl Swedberg


You could try something like this:

$('someListItem').click(function() {
  $('#cluetip').hide().removeClass().children().empty();
});

Replace someListItem with the actual selector you need.

Let me know if this works for you.

--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Nov 25, 2007, at 2:20 PM, Tim wrote:



i am using clueTip with ajax to grab a list from a db.  i would like
the clueTip to close when the user selects an item from the list.  i'm
guessing there is an easy way to do this, but i've tried for a while
now without any success.  i tried calling cluetipClose() with the
onclick event, but since the clueTip is a separate web page, it is
saying that cluetipClose() is not defined.  any ideas?  thanks.




[jQuery] Re: jQuery minified size could be wrong?

2007-11-25 Thread Karl Swedberg

Hi Marco,

Your host's server needs to support gzip or mod_deflate in order to  
get the benefit of that small file size. The jquery.com home page  
links Minified and Gzipped to a blog entry by Julien LeComte, which  
explains the gzip thing:

http://www.julienlecomte.net/blog/2007/08/13/


--Karl
_
Karl Swedberg
www.englishrules.com
www.learningjquery.com



On Nov 25, 2007, at 3:47 PM, Web Specialist wrote:

jQuery page allows us to download jQuery minified and Gzipped with  
14.1kb using this link:


http://code.google.com/p/jqueryjs/downloads/detail?name=jquery-1.2.1.min.js

But after download it that plugin haves 46kb.

John, what's wrong?

Cheers

Marco Antonio




[jQuery] Re: ANNOUCE: jQuery lightBox plugin

2007-11-25 Thread Leandro Vieira Pinho

Hi Erlend,

Thanks to give me the attention to iframe possibility in question
about Flash. I´ll analise it in future versions.

The preloading image is normal. I didn´t alter it.

An option to turn off the effects is comming too :)

Regards

On Nov 19, 2007 10:43 AM, Erlend Schei [EMAIL PROTECTED] wrote:

  Released the 0.4 version of jQuery lightBox plugin.

 Lovely, Leandro! The visibility stuff was marvellous, and I'm quite
 annoyed over not having thought of it myself :) The background truly
 benefits from not jumping up and down with elements being displayed as
 none. May I suggest that you add iframes to the list as well? A lot of
 flash ads served through iframes shine through.

 Is there a reason why you have turned off the preloading of the next
 image? The plugin now seems somewhat less responsive than in version
 0.3. I loved the preloading bit which made it very snappy. Also, going
 back to the previous (and thus already loaded) image seems slower, and
 I get the unneccesary loading gif. I'd very much appreciate having the
 preloading back, and not displaying the loading gif when it's not
 necessary.

 Thanks again for your tremendous work!

 I'd love an option to turn off all effects, to make the expreience
 faster, although less fancy. The fade to black, timed resize of image
 container and the sliding text box.

 Erlend Schei :)

 




-- 
Grato
Leandro Vieira Pinho
Diretor da w3invent - http://w3invent.com.br
Blog pessoal sobre Desenvolvimento Web - http://leandrovieira.com
Colunista semanal iMasters - http://www.imasters.com.br/


[jQuery] Re: IE Help.

2007-11-25 Thread Austin Pickett

Heh.. didn't mean to double post, just when I posted first it didn't
update for a while so i thought I did something wrong :\

On Nov 25, 2:12 am, Austin Pickett [EMAIL PROTECTED] wrote:
 Thanks for the link, I checked it out however what they gave had no
 effect on me :\
 Alright, I'll post the code of which I'm actually working with.

 $(document).ready(function() {
   $('.show_comments').click(function(){
 $('#showdiv').slideToggle('fast');
   });

 });

 That's all it is, I can't seem to see anything wrong with it; when I
 go into FF it works fine, but in IE 6.0 it shows the comments box
 shown and the option to show / hide the comments does not work. I'm
 rather new to the JQuery language let alone the JavaScript language so
 maybe someone could see something I don't?

 On Nov 24, 7:33 pm, bingo [EMAIL PROTECTED] wrote:

  hi Austin,

  I am not sure what's the problem..but make sure you are not making any
  of these mistakes (listed in the 
  blog)http://ragrawal.wordpress.com/2007/10/25/top-5-reasons-why-ie7-is-com...

  Regards

  On Nov 24, 3:52 pm, Austin Pickett [EMAIL PROTECTED] wrote:

   Are there any ie hacks or maybe some ie tricks with jquery?
   Ie's being stubborn with me and whenever i try to make a simple slider

   click x { show y }

   type of thing it doesn't even work.

  Does anyone else have trouble with IE and Jquery?


[jQuery] textarea cursor position

2007-11-25 Thread Andrew Ma

Hello,
I'm looking for a snippet of code or a plugin that will give me the
current position of the cursor within a textarea.
Does anyone have one that they can share?


[jQuery] Re: Form question

2007-11-25 Thread nathandh



Actually, here's the whole thing for context:

$('input#same').toggle(function() {
$(this).attr(checked, checked);
$('#billing input').attr(disabled, disabled);
$('#billing input').each(function(i) {
$(this).val( $('#shipping input').eq(i).val() );
});
$('#billing').fadeOut();
}, function() {
$(this).attr(checked, );
$('#billing input').attr(disabled, );
$('#billing').fadeIn();
});



[jQuery] Re: JQuery Tabs not loading on first click

2007-11-25 Thread sukhminder

Thanks Klaus - worked perfectly.

On Nov 23, 9:34 pm, Klaus Hartl [EMAIL PROTECTED] wrote:
 On 23 Nov., 12:39,sukhminder[EMAIL PROTECTED] wrote:





  Tabs are not loading on the first click. I have a link which is like:

  li class=newsa href=javascript:loadTabs('news')Headlines/a/
  li

  when user clicks on this it calls the following function:

  script
  function loadTabs(filename) {
  $('head').append('link type=text/css href='+ webroot + 'css/
  ui.tabs.css rel=stylesheet /');
  $.getScript(webroot + script/ui.tabs.js);
  $.get(webroot + html/+filename+.htm, function(data){
  $(#cbody).html(+data+);
  $(#newscontainer ul).tabs({ remote: true, fxSlide: true, 
  fxFade:
  true, fxSpeed: 'normal' });
  });}

  /script

  this function loads the required css and javascript tabs file to
  display tabs; but when I click on it it gives me the following error:

  $(#newscontainer ul).tabs is not a function
  [Break on this error] $(#newscontainer ul).tabs({ remote: true,
  fxSlide: true, fxFade: true, fxSpe...

  However, it does work when I click on the link again. Any idea why
  this is happening? This wasn't happening on my dev server. Here is the
  link to the actual site:http://www.ranglapunjab.net/

  Thanks in advance.

 My guess is this is due to asynchronous loading. When clicking first
 time ui.tabs.js gets loaded but when executing the tabs() method on
 the next line the browser is still loading the file. Second time you
 click it has been loaded, thus no error any longer.

 Try to call tabs in the callback of the getScript method:

 $.getScript(webroot + script/ui.tabs.js, function() {
 $(#newscontainer ul).tabs({ remote: true, fxSlide: true, fxFade:
 true, fxSpeed: 'normal' });

 });

 --Klaus- Hide quoted text -

 - Show quoted text -


[jQuery] Re: Form question

2007-11-25 Thread nathandh


If anybody's interested, here's what I came up with:

$('#billing input').each(function(i) {
 $(this).val( $('#shipping input').eq(i).val() );
});

Works like a charm.


[jQuery] Getting the index of a cell in a row.

2007-11-25 Thread jonhobbs

Hi,

I hope somebody can help me. I'm trying to write a function which will
tick every checkbox in a column when you tick the checkbox in the
header.

The plan is to attach an evetn to every checkbox in the header which
when you check it will find the column bumber of the cell it is in and
plug that number into the following code where the x is...

$(.Grid tbody tr td:nth-child(x)
[EMAIL PROTECTED]'checkbox']).each(function() {
this.checked = true;
});

I can figure out how to get the parent element of the checkbox (which
will be a TD), just don't know how to find out that cells position in
the table row.

Any help would be appreciated.


[jQuery] cluetip additional functionality

2007-11-25 Thread barefoot1972

The jquery.com suggest a feature would not let me login.  So I am
posting it here.   I added focus/blur event handling to cluetip. So it
can be used in conjunction with forms or other elements that you might
not want to hover or click.


added to: jquery.cluetip.js

=BIND EVENTS
-- */

  // activate by focus
} else if (defaults.activation == 'focus') {

$this.focus(function(event) {
activate(event);
  });

  $this.blur(function(event) {
inactivate(event);
  });


[jQuery] Re: Simple Question: Using Variables in jQuery

2007-11-25 Thread Brett

The way you've described it, if you want to have the same name on two
elements, you might be using a class instead of an id.

instead of div id=somethingcontent/div try div
class=somethingcontent/div - which will freely let you use it
multiple times safely.

On Nov 24, 4:07 pm, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:
 On Nov 23, 4:46 pm, yetanother [EMAIL PROTECTED] wrote:

  $(ul#myID).load(data.html);

 You need to use JavaScript string concatenation to build the selector:

 $(url# + myID).load(data.html);

 Also, you'll probably want to avoid assigning the same ID to two
 different elements.  You're constructing invalid HTML otherwise, and
 it'll likely cause weird results with some browsers.  The way I'd do
 it is to have the two IDs follow some convention, but with different
 prefixes, eg. assign $id to the link and content_$id to the list
 elements.  Then construct the list element ID from the link value:

 $(#content_ + myID).load(data.html);

 You don't need the ul selector then, because an ID uniquely identifies
 a single element on the page.

 - Jonathan


[jQuery] Re: jQuery Form Plugin Doesn't execute on returned forms?

2007-11-25 Thread Geoff Millikan

I think you guys are cool.  I really appreciate that you guys are
spending your time helping others like this.  I hope you get some
reward for this other than seeing people communicating more
effectively on the 'net.

Anyway, I read the  Why do my events stop working FAQ 3 or 4 times,
read the AJAX and Events Tutorial twice and looked at the source
code and tried the Live Query plugin by Brandon Aaron.

I understand that somehow the new form has to added to the existing
DOM.  I understand the examples working with a click event.  However
in this case, there's no  clickable anchors such as $('a').click(fn);
- this is just a form.  I'm can't seem to get the new form into the
existing DOM.

The best I could do was trying to insert the the ajaxForm as a
function within the original call but that didn't seem to do it as in
the below or at the link below
http://mammoth.t1shopper.com/voip/ajaxform.html
var options = {target:'#output1'};
$('#wizard1').ajaxForm(options, function () {
   var options = {target:'#output1'};
   $('#wizard1').ajaxForm(options);
}
);

I think this is beyond my ability but again, I applicate everything
you guys are doing to make complicated things like this in reach for a
lot more people.


[jQuery] Re: jQuery.easing[this.options.easing || (jQuery.easing.swing ? swing : linear)] is not a function

2007-11-25 Thread MorningZ

I ran into this error today and realized i had the ease method spelled
wrong  (had 'easeOutBonce' - no u)

Fixing the misspell got rid of the error that is in the subject line
of this thread  :-)





On Nov 9, 10:28 am, George GSGD [EMAIL PROTECTED] wrote:
 Can you give me some example code? Generally if there's a problem with
 callbacks it's a syntax error.

 On Nov 9, 7:39 am, Tóbi [EMAIL PROTECTED] wrote:

  I think there is a bug. When I call the slideIn/Out function I get
  errors as well, because when the function called then it call the
  animate func but with wrong parameter order/count. The animate funct
  get the callback fn (if it presents) as easing parameter.
  This is a bug, isn't it?


[jQuery] Bug in jQuery selector or am I just not understanding?

2007-11-25 Thread Mark Lacas

Why does the code below show the values for the two alerts to be:
bilbo and layout_1 ?

I would have expected: bilbo and bilbo.

I thought the cascading selectors would have chosen the dp_properties
class that is the first child level of the selected div. . .not the
dp_properties class buried two levels down (but appearing first in the
DOM listing).

I would have thought that I would have had to use more selectors to
get into there specifically?

This really breaks my thinking of how jQuery works.  Do I really need
to know what elements are in between to know that a selector is
working properly?  What syntax would I use to get the one I want (the
last and outermost)?

Thoughts, answers, fixes?

Thanks,
ml

alert( $( #395 ).attr(dp_id) );
alert( $( #395 .dp_properties ).attr( dp_id ) );

div id=395 dp_id=bilbo
div class=dp_view_container
div id=411  dp_id=layout_1  dp_id_num=411
div class=dp_properties dp_id_num=411 
dp_id=layout_1/div
/div
/div
div class=dp_properties dp_id_num=395 dp_id=bilbo/div
/div




[jQuery] Making jQuery turn up on time (document.ready and firing too early)

2007-11-25 Thread Brett

Many of us know here that making jQuery run on the right time has been
a bit of a hassle in the past, mainly due to how document.ready is
interpreted differently, and sometimes jQuery can fire when the DOM
isn't complete - so , all that nice jquery code you have will not be
able to work correctly.


It looks like this problem has existed for a long time ( discussion
about this same thing in 2006:
http://groups.google.com/group/jquery-en/browse_thread/thread/fbf619d536e87721/cdeeab2799895486?lnk=gstq=document.ready#cdeeab2799895486
)

A partial solution is to use document.ready() at the bottom of the
page, to hopefully have it run last.
http://groups.google.com/group/jquery-en/browse_thread/thread/8570c3a4347c6592/3ad19fbc9b50649f?lnk=gstq=document.ready#3ad19fbc9b50649f
This still gets borked if the user has the file in cache though, I
think.

The reason I bring this up is because the jquery I've been using has
problems running on ie6 all of the time, and confuses people who are
on the receiving end of the problem.

A navigation that will occasionally not fire:
http://cressaid.brettjamesonline.com/BVCI/BVCI/telco.html

 $(function(){
 $('a.choicelist').bind('click',
function()
{
// Actual code to run
})
 });

^--- I'm sure I could just use document ready here, right?
(OT, but I noticed that In internet explorer, the first line of any
product you choose is indented too - not sure what's the cause of
that.)



An example of jQuery code running in document.ready if anyone wants to
test the difference:
http://cressaid.brettjamesonline.com/BVCI/index.html

So I guess what we should do is, try and get a list of possible ways
to run jquery ( I know of  $(function(){  in a js block of code,
document.ready , and a very buggy window.onLoad() - Even if it will be
fixed in upcoming versions hopefully, I guess a lot of people will
still be running older versions of jQuery.


[jQuery] Re: Bug in jQuery selector or am I just not understanding?

2007-11-25 Thread Brett

That code is a bit hard to read
I would have written the html to be more semantic, instead of using
lots of div tags.

Still, the exact code if that was in css should be
div div div div.dp_properties - so you can see why it reads a bit
confusing.

I like the idea of defining a tag and using its info though (dp_id) :)

I'm not sure i've fully answered your question though, so let us know
how  you go.

On Nov 26, 12:24 pm, Mark Lacas [EMAIL PROTECTED] wrote:
 Why does the code below show the values for the two alerts to be:
 bilbo and layout_1 ?

 I would have expected: bilbo and bilbo.

 I thought the cascading selectors would have chosen the dp_properties
 class that is the first child level of the selected div. . .not the
 dp_properties class buried two levels down (but appearing first in the
 DOM listing).

 I would have thought that I would have had to use more selectors to
 get into there specifically?

 This really breaks my thinking of how jQuery works.  Do I really need
 to know what elements are in between to know that a selector is
 working properly?  What syntax would I use to get the one I want (the
 last and outermost)?

 Thoughts, answers, fixes?

 Thanks,
 ml

 alert( $( #395 ).attr(dp_id) );
 alert( $( #395 .dp_properties ).attr( dp_id ) );

 div id=395 dp_id=bilbo
 div class=dp_view_container
 div id=411  dp_id=layout_1  dp_id_num=411
 div class=dp_properties dp_id_num=411 
 dp_id=layout_1/div
 /div
 /div
 div class=dp_properties dp_id_num=395 dp_id=bilbo/div
 /div


[jQuery] reset toggle

2007-11-25 Thread befidled

I've currently got a list where each list element fades in a
corresponding div when clicked. It's set to toggle so that it will
fade out the same div when clicked again. I've set it up to also hide
all divs so that they don't overlap each other.

my code is below...my question is, is there a more efficient way to
achieve the same thing?

$('a.question1').toggle(function(){
$('div.answer1, div.answer2, div.answer3, div.answer4, 
div.answer5,
div.answer6').fadeOut();
var answers = $('div.answer1');
answers.fadeIn();
}, function(){
$('div.answer1, div.answer2, div.answer3, div.answer4, 
div.answer5,
div.answer6').fadeOut();
var answers = $('div.answer1');
answers.fadeIn();
});



[jQuery] Re: Bug in jQuery selector or am I just not understanding?

2007-11-25 Thread Dave Methvin

 I thought the cascading selectors would have chosen the dp_properties
 class that is the first child level of the selected div. . .not the
 dp_properties class buried two levels down (but appearing first in the
 DOM listing).

jQuery selectors work pretty much the same way they do in CSS.

This selects all *descendants* of #mydiv that have class .myclass:

  #mydiv .myclass

This selects all *immediate children* of #mydiv that have
class .myclass:

  #mydiv  .myclass

The #395 .dp_properties selector finds two divs and you are only
alerting the dp_id value of the first one.

Also, in a valid HTML4 document, ids can't start with a digit and
there is no dp_id attribute on divs. Invalid HTML may not work on all
browsers.

http://validator.w3.org/


[jQuery] Re: reset toggle

2007-11-25 Thread Glen Lipka
Are you trying to do something like this?
http://www.commadot.com/jquery/faq.php

I can think of a few ways to make your code more jQuery-ish.

Glen

On Nov 25, 2007 6:00 PM, befidled [EMAIL PROTECTED] wrote:


 I've currently got a list where each list element fades in a
 corresponding div when clicked. It's set to toggle so that it will
 fade out the same div when clicked again. I've set it up to also hide
 all divs so that they don't overlap each other.

 my code is below...my question is, is there a more efficient way to
 achieve the same thing?

 $('a.question1').toggle(function(){
$('div.answer1, div.answer2, div.answer3,
 div.answer4, div.answer5,
 div.answer6').fadeOut();
var answers = $('div.answer1');
answers.fadeIn();
}, function(){
$('div.answer1, div.answer2, div.answer3,
 div.answer4, div.answer5,
 div.answer6').fadeOut();
var answers = $('div.answer1');
answers.fadeIn();
 });