Re: [jQuery] return false

2007-03-24 Thread Sebastián V . Würtz
Well maybe isnt the return my problem, really is the behaviour, why when i 
clicl in the link it disapear- "appear with the same content" and then 
appear within the data loaded via ajax? I mean i want the container only 
hide and show whitin the content loaded nothing more.

Maybe my english is very bad, so sorry.
Sebastian


- Original Message - 
From: "Evan" <[EMAIL PROTECTED]>
To: 
Sent: Friday, March 23, 2007 9:32 PM
Subject: Re: [jQuery] return false


By putting return false, you're preventing the default behaviour of
the anchor, otherwise it would still fire like a normal link.

Alternatively, you could use another element (like a span, styled like
an anchor) to achieve the same effect.

On Mar 24, 8:30 am, Sebastián V. Würtz <[EMAIL PROTECTED]> wrote:
> I have a html like this
>
>
> 
> cat1
> 
> ...
> 
>
> The html
>
>  $('#list a').each(function(i){
> $(this).click(function(event){
> $("#list").fadeOut("slow").load(this.href);
> $("#list").fadeIn("slow");return false;
>
> })
>
> When i click in 1 option the "list" hide (fadeOut); load the page; appear 
> again the list; and then the page appear. If i dont put the "return false" 
> i got the empty page not like a "content"
>
> How i can fix it?
>
> Thx
> Sebastián
>
> 
> Estoy utilizando la versión gratuita de SPAMfighter para usuarios 
> privados.
> Ha eliminado 6225 correos spam hasta la fecha.
> Los abonados no tienen este mensaje en sus correos.
> ¡Pruebe SPAMfighter gratis ya!
>
> ___
> jQuery mailing list
> [EMAIL PROTECTED]://jquery.com/discuss/


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

__ NOD32 2142 (20070324) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




Estoy utilizando la versión gratuita de SPAMfighter para usuarios privados.
Ha eliminado 6257 correos spam hasta la fecha.
Los abonados no tienen este mensaje en sus correos.
¡Pruebe SPAMfighter gratis ya!


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


[jQuery] return false

2007-03-23 Thread Sebastián V . Würtz
I have a html like this 

   

cat1

...



The html

 $('#list a').each(function(i){
$(this).click(function(event){
$("#list").fadeOut("slow").load(this.href);
$("#list").fadeIn("slow");return false;
})

When i click in 1 option the "list" hide (fadeOut); load the page; appear again 
the list; and then the page appear. If i dont put the "return false" i got the 
empty page not like a "content"

How i can fix it?

Thx
Sebastián


Estoy utilizando la versión gratuita de SPAMfighter para usuarios privados.
Ha eliminado 6225 correos spam hasta la fecha.
Los abonados no tienen este mensaje en sus correos.
¡Pruebe SPAMfighter gratis ya!
___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/


Re: [jQuery] get element inside a div simple question

2007-03-02 Thread Sebastián V . Würtz
Ok, this is how my final (?) code look
I think it have too many if, a function for make the same thing could help 
but at least it work and perfectly

 $("#toc").addClass("toc derecha");
 $("#toc").prepend('Tabla de contenidos<\/h2><\/ul>');

 counter = 1;
 $('*','#main_content').each(function() {
  if ( $(this).attr('id') !='toctitle' ) {
   if ( $(this).is("H2") )
   {
$(this).before('');
$("#toc ul").append('' + (counter++) + '. ' + $(this).html() + '<\/a><\/li>');
   }
   else if ( $(this).is("H3") )
   {
$(this).before('');
$("#toc ul").append('' + (counter++) + '. ' + $(this).html() + '<\/a><\/li>');
   }
   else if  ( $(this).is("H4") )
   {
$(this).before('');
$("#toc ul").append('' + (counter++) + '. ' + $(this).html() + '<\/a><\/li>');
   }
   else if ( $(this).is("H5") )
   {
$(this).before('');
$("#toc ul").append('' + (counter++) + '. ' + $(this).html() + '<\/a><\/li>');
   }
  }
 });


U need to use a css and put in your html


where u want the toc appear

if any1 wanna contrib with my first jquery advanced programation can help 
lol


thx
sebastian




- Original Message - 
From: "Blair Mitchelmore" <[EMAIL PROTECTED]>
To: "jQuery Discussion." 
Sent: Friday, March 02, 2007 9:03 PM
Subject: Re: [jQuery] get element inside a div simple question


If I recall correctly, to get it in order you need to take all elements
and then filter manually or do it hierarchically.

One way:
$('*',main_content).each(function() {
if (this.tagName.toLowerCase() == 'h1')
   // ...
else if (this.tagName.toLowerCase() == 'h2')
   // ...
// etc.
});

The Other:
$('h1',main_content).each(function() {
$('h2',this).each(function() {
   // and so on..
});
});

Which one you use would depend on what your ultimate goal is, though I'm
sure either technique can be modified to suit any situation.

-blair

sebastianw wurtz wrote:
> But still isnt what i need i making a auto gen table of content list i
> have this
>
> var main_content = $("#main_content");
> var toBeTOCced = $("h2,h3,h4,h5", main_content);
> toBeTOCced.each(function(i) {
>.
>.
> });
>
> * 1. Title 1
> * 3. Title 2
> * 4. Title 3
> * 5. Title 4
> * 6. Title 5
> * 7. Title 2.1
> * 8. Title 2.2
> * 9. Title 4.1
> * 10. Title 4.1
>
> Seems to be not in order. Like is usual i need to put the
> 2
> 2.1
> 2.2
> 
> ...
>
>
>
>
> - Mensaje original 
> De: Blair Mitchelmore <[EMAIL PROTECTED]>
> Para: jQuery Discussion. 
> Enviado: viernes 2 de marzo de 2007, 20:44:55
> Asunto: Re: [jQuery] get element inside a div simple question
>
> var main_content = $("#main_content");
> var toBeTOCced = $("h2,h3,h4,h5", main_content); // there it is
>
> -blair
>
> sebastianw wurtz wrote:
> > I want to get all the Heading element up to 5 (ex |h2,h3,h4,h5| )
> > inside a div like #main_content
> >
> > something like this, but inside the #main_content
> > |var toBeTOCced = getElementsByTagNames('h2,h3,h4,h5');|
> >
> > How i can do that with jquery?
> >
> >
> > thanks
> >
> > Sebastián
> >
>


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/

__ NOD32 2090 (20070302) Information __

This message was checked by NOD32 antivirus system.
http://www.eset.com




Estoy utilizando la versión gratuita de SPAMfighter para usuarios privados.
Ha eliminado 5021 correos spam hasta la fecha.
Los abonados no tienen este mensaje en sus correos.
¡Pruebe SPAMfighter gratis ya!


___
jQuery mailing list
discuss@jquery.com
http://jquery.com/discuss/