[jQuery] Re: Complicated setup help.

2009-06-05 Thread Aaron Gundel

Hi Dave,

It appears that your method signature for attr function is incorrect.
See http://docs.jquery.com/Attributes for details (Looks like you're
passing in an anonymous function as the third parameter of the attr
function...this won't work.  You'd need to pass it in as the second
value -- this function serves to return a value to which the attribute
can be set.  So you'd omit 'true' in your case and replace with the
function that would return true or false -- that's why that function
is there.)  I suspect this is why your javascript execution stops
early

http://www.w3.org/TR/REC-html40/struct/links.html#edef-A Also note
that disabled is not a valid attribute for the anchor tag.  If you
want to disable a link, you might try creating another tag (a
paragraph tag perhaps) that contained your link text and swap them
out.  This would have the effect that it seems you're looking for.

Perhaps someone else will have something else to add.

Aaron

On Thu, Jun 4, 2009 at 4:50 PM, Dave Maharaj ::
WidePixels.com wrote:
> OK forget previous post
>
> How can I disable all links with $('a[class^="edit_"]') after one is
> clicked?
>
> what I did was fade the other buttons out when 1 is clicked. But how can I
> disable the buttons temporarily?
>
> I added$('a[class^="edit_"]').attr("disabled",true , function() {  to my
> script but thats stops the action and nothing happens after that line is
> run.
>
> $('a[class^="edit_"]').click(function(){
>  var url_id = $(this).attr('href');
>  var x = $(this).attr('id').split('_');
>  var y = x[0];
>  var z = x[1];
>
>    $('a[class^="edit_"]').fadeTo('slow' , 0.25 , function() {
> $('a[class^="edit_"]').attr("disabled",true , function() {
> $('#resume_'+z).slideUp( 500 , function(){
>  $('#loading_'+z).show('fast', function() {
>   $('#resume_'+z).load( url_id , function(){
>    $('#loading_'+z).hide(function(){
> $('#resume_'+z).slideDown( 500 , function() {
>  $('#resume_'+z).fadeTo('fast', 1, function() {
>   $('#resume_'+z).fadeIn('slow');
>   });
>  });
> });
>    return false;
>    });
>   });
>  });
> });
>    });
>    });
>
> 
> From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com]
> Sent: June-04-09 8:50 PM
> To: jquery-en@googlegroups.com
> Subject: [jQuery] Complicated setup help.
>
> I have run into a problem.
>
> I have
> 
>   
>     Heading
>      Sample here
>   
> 
>  Edit
> 
>
> 
>   
>     Heading
>      Sample here
>   
> 
>  Edit
> 
>
> same thing as above for 3 other sections..
>
> Click edit loads an ajax submitted form (jQuery form Plugin from malsup)
> into the   so all the  is replaced
> by the form..submit and the new  data is updated.
>
> But if a user clicks edit for set 1 then edit for set 2,3,4,and 5 all 5 divs
> are updated with forms, the page is now long and ugly and the forms will not
> submit. Easiest way would be to close each set+xx if they click on another
> edit link but how can i tell a set has an open form and how can i return the
> original data?
>
> I was thinking of an accordian style setup where if user clicks on another
> edit any open sets will be closed.
>
> Ideas? Thoughts? Suggestions?
>
> thanks,
>
> Dave


[jQuery] Re: Complicated setup help.

2009-06-04 Thread Dave Maharaj :: WidePixels.com
OK forget previous post 
 
How can I disable all links with $('a[class^="edit_"]') after one is
clicked?
 
what I did was fade the other buttons out when 1 is clicked. But how can I
disable the buttons temporarily?
 
I added$('a[class^="edit_"]').attr("disabled",true , function() {  to my
script but thats stops the action and nothing happens after that line is
run.
 
$('a[class^="edit_"]').click(function(){
 var url_id = $(this).attr('href');
 var x = $(this).attr('id').split('_');
 var y = x[0];
 var z = x[1];
  
   $('a[class^="edit_"]').fadeTo('slow' , 0.25 , function() {
$('a[class^="edit_"]').attr("disabled",true , function() {
$('#resume_'+z).slideUp( 500 , function(){
 $('#loading_'+z).show('fast', function() {
  $('#resume_'+z).load( url_id , function(){
   $('#loading_'+z).hide(function(){
$('#resume_'+z).slideDown( 500 , function() {
 $('#resume_'+z).fadeTo('fast', 1, function() {
  $('#resume_'+z).fadeIn('slow');
  });  
 }); 
});
   return false;
   });
  });
 });
});
   });
   });
 


  _  

From: Dave Maharaj :: WidePixels.com [mailto:d...@widepixels.com] 
Sent: June-04-09 8:50 PM
To: jquery-en@googlegroups.com
Subject: [jQuery] Complicated setup help.


I have run into a problem.
 
I have

  
Heading
 Sample here
  

 Edit

 

  
Heading
 Sample here
  

 Edit

 
same thing as above for 3 other sections..
 
Click edit loads an ajax submitted form (jQuery form Plugin from malsup)
into the   so all the  is replaced
by the form..submit and the new  data is updated.
 
But if a user clicks edit for set 1 then edit for set 2,3,4,and 5 all 5 divs
are updated with forms, the page is now long and ugly and the forms will not
submit. Easiest way would be to close each set+xx if they click on another
edit link but how can i tell a set has an open form and how can i return the
original data?
 
I was thinking of an accordian style setup where if user clicks on another
edit any open sets will be closed.
 
Ideas? Thoughts? Suggestions?
 
thanks,
 
Dave