HighDots Forums  

Append Help

jQuery jQuery is a fast, concise, JavaScript Library that simplifies how you traverse HTML documents, handle events, perform animations, and add Ajax interactions to your web pages. jQuery is designed to change the way that you write JavaScript.


Discuss Append Help in the jQuery forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Dave Maharaj :: WidePixels.com
 
Posts: n/a

Default Append Help - 11-04-2009 , 12:01 PM






I am uploading images and once uploaded they appear in my sortable list.

I have
success response:

$('<li></li>').appendTo('#sortable').fadeIn('slow').html(re sponse);

page code:
<ul id="sortable" class="files">
<li>image1</li> -> are there when the page loads
<li>image2</li> -> are there when the page loads
<li>image3</li> -> are there when the page loads

<li>image4</li> -> newly added image appears here but I would like it to
appear above image1
</ul>

But I would like to have it appear at the top. What I have adds it to the
very bottom of the list. How can I have it appear at the top of the list?

Thanks

Dave

Reply With Quote
  #2  
Old   
Charlie Griefer
 
Posts: n/a

Default Re: [jQuery] Append Help - 11-04-2009 , 12:05 PM






shot in the dark here... but prependTo()?

On Wed, Nov 4, 2009 at 9:01 AM, Dave Maharaj :: WidePixels.com <
dave (AT) widepixels (DOT) com> wrote:

Quote:
I am uploading images and once uploaded they appear in my sortable list.

I have
success response:

$('<li></li>').appendTo('#sortable').fadeIn('slow').html(re sponse);

page code:
ul id="sortable" class="files"
li>image1</li> -> are there when the page loads
li>image2</li> -> are there when the page loads
li>image3</li> -> are there when the page loads

li>image4</li> -> newly added image appears here but I would like it to
appear above image1
/ul

But I would like to have it appear at the top. What I have adds it to the
very bottom of the list. How can I have it appear at the top of the list?

Thanks

Dave



--
Charlie Griefer
http://charlie.griefer.com/

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.

Reply With Quote
  #3  
Old   
Dave Maharaj :: WidePixels.com
 
Posts: n/a

Default RE: [jQuery] Append Help - 11-04-2009 , 12:09 PM



That certainly was fast.

Thanks, just what i needed.

Dave

_____

From: Charlie Griefer [mailto:charlie.griefer (AT) gmail (DOT) com]
Sent: November-04-09 1:35 PM
To: jquery-en (AT) googlegroups (DOT) com
Subject: Re: [jQuery] Append Help


shot in the dark here... but prependTo()?


On Wed, Nov 4, 2009 at 9:01 AM, Dave Maharaj :: WidePixels.com
<dave (AT) widepixels (DOT) com> wrote:


I am uploading images and once uploaded they appear in my sortable list.

I have
success response:

$('<li></li>').appendTo('#sortable').fadeIn('slow').html(re sponse);

page code:
<ul id="sortable" class="files">
<li>image1</li> -> are there when the page loads
<li>image2</li> -> are there when the page loads
<li>image3</li> -> are there when the page loads

<li>image4</li> -> newly added image appears here but I would like it to
appear above image1
</ul>

But I would like to have it appear at the top. What I have adds it to the
very bottom of the list. How can I have it appear at the top of the list?

Thanks


Dave




--
Charlie Griefer
http://charlie.griefer.com/

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.

Reply With Quote
  #4  
Old   
Dave Maharaj :: WidePixels.com
 
Posts: n/a

Default RE: [jQuery] Append Help Issue - 11-04-2009 , 12:40 PM



Ok i changed the code to:

$('<li></li>').prependTo('#sortable').fadeIn('slow').html(r esponse);

My response is already in a <li> which has variables from the php script so
I need it returned in the response.

So I end up with being added to the sortable list (extra li set i dont need)
<li>
<li id ="my_id">code.....
</li>
</li>

How can I just insert the response to the #sortable at the top?

Thanks again,

Dave

_____

From: Dave Maharaj :: WidePixels.com [mailto:dave (AT) widepixels (DOT) com]
Sent: November-04-09 1:40 PM
To: jquery-en (AT) googlegroups (DOT) com
Subject: RE: [jQuery] Append Help


That certainly was fast.

Thanks, just what i needed.

Dave

_____

From: Charlie Griefer [mailto:charlie.griefer (AT) gmail (DOT) com]
Sent: November-04-09 1:35 PM
To: jquery-en (AT) googlegroups (DOT) com
Subject: Re: [jQuery] Append Help


shot in the dark here... but prependTo()?


On Wed, Nov 4, 2009 at 9:01 AM, Dave Maharaj :: WidePixels.com
<dave (AT) widepixels (DOT) com> wrote:


I am uploading images and once uploaded they appear in my sortable list.

I have
success response:

$('<li></li>').appendTo('#sortable').fadeIn('slow').html(re sponse);

page code:
<ul id="sortable" class="files">
<li>image1</li> -> are there when the page loads
<li>image2</li> -> are there when the page loads
<li>image3</li> -> are there when the page loads

<li>image4</li> -> newly added image appears here but I would like it to
appear above image1
</ul>

But I would like to have it appear at the top. What I have adds it to the
very bottom of the list. How can I have it appear at the top of the list?

Thanks


Dave




--
Charlie Griefer
http://charlie.griefer.com/

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.

Reply With Quote
  #5  
Old   
Charlie Griefer
 
Posts: n/a

Default Re: [jQuery] Append Help Issue - 11-04-2009 , 12:47 PM



Try prepend() instead of prependTo()?

http://docs.jquery.com/Manipulation/prepend

On Wed, Nov 4, 2009 at 9:40 AM, Dave Maharaj :: WidePixels.com <
dave (AT) widepixels (DOT) com> wrote:

Quote:
Ok i changed the code to:

$('<li></li>').prependTo('#sortable').fadeIn('slow').html(r esponse);

My response is already in a <li> which has variables from the php script so
I need it returned in the response.

So I end up with being added to the sortable list (extra li set i dont
need)
li
li id ="my_id">code.....
/li
/li

How can I just insert the response to the #sortable at the top?

Thanks again,

Dave

------------------------------
*From:* Dave Maharaj :: WidePixels.com [mailto:dave (AT) widepixels (DOT) com]
*Sent:* November-04-09 1:40 PM
*To:* jquery-en (AT) googlegroups (DOT) com
*Subject:* RE: [jQuery] Append Help

That certainly was fast.

Thanks, just what i needed.

Dave

------------------------------
*From:* Charlie Griefer [mailto:charlie.griefer (AT) gmail (DOT) com]
*Sent:* November-04-09 1:35 PM
*To:* jquery-en (AT) googlegroups (DOT) com
*Subject:* Re: [jQuery] Append Help

shot in the dark here... but prependTo()?

On Wed, Nov 4, 2009 at 9:01 AM, Dave Maharaj :: WidePixels.com
dave (AT) widepixels (DOT) com> wrote:

I am uploading images and once uploaded they appear in my sortable list.

I have
success response:

$('<li></li>').appendTo('#sortable').fadeIn('slow').html(re sponse);

page code:
ul id="sortable" class="files"
li>image1</li> -> are there when the page loads
li>image2</li> -> are there when the page loads
li>image3</li> -> are there when the page loads

li>image4</li> -> newly added image appears here but I would like it to
appear above image1
/ul

But I would like to have it appear at the top. What I have adds it to the
very bottom of the list. How can I have it appear at the top of the list?

Thanks

Dave




--
Charlie Griefer
http://charlie.griefer.com/

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.



--
Charlie Griefer
http://charlie.griefer.com/

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.

Reply With Quote
  #6  
Old   
Dave Maharaj :: WidePixels.com
 
Posts: n/a

Default RE: [jQuery] Append Help Issue - 11-04-2009 , 12:49 PM



I went with

$(response).fadeIn('slow').prependTo('#sortable');

It works as I need it but not sure if that coded right.
So the response fades in slow and inserted into the top of the sortable list

Dave

_____

From: Charlie Griefer [mailto:charlie.griefer (AT) gmail (DOT) com]
Sent: November-04-09 2:17 PM
To: jquery-en (AT) googlegroups (DOT) com
Subject: Re: [jQuery] Append Help Issue


Try prepend() instead of prependTo()?

http://docs.jquery.com/Manipulation/prepend


On Wed, Nov 4, 2009 at 9:40 AM, Dave Maharaj :: WidePixels.com
<dave (AT) widepixels (DOT) com> wrote:


Ok i changed the code to:

$('<li></li>').prependTo('#sortable').fadeIn('slow').html(r esponse);

My response is already in a <li> which has variables from the php script so
I need it returned in the response.

So I end up with being added to the sortable list (extra li set i dont need)
<li>
<li id ="my_id">code.....
</li>
</li>

How can I just insert the response to the #sortable at the top?

Thanks again,

Dave

_____

From: Dave Maharaj :: WidePixels.com [mailto:dave (AT) widepixels (DOT) com]
Sent: November-04-09 1:40 PM
To: jquery-en (AT) googlegroups (DOT) com
Subject: RE: [jQuery] Append Help


That certainly was fast.

Thanks, just what i needed.

Dave

_____

From: Charlie Griefer [mailto:charlie.griefer (AT) gmail (DOT) com]
Sent: November-04-09 1:35 PM
To: jquery-en (AT) googlegroups (DOT) com
Subject: Re: [jQuery] Append Help


shot in the dark here... but prependTo()?


On Wed, Nov 4, 2009 at 9:01 AM, Dave Maharaj :: WidePixels.com
<dave (AT) widepixels (DOT) com> wrote:


I am uploading images and once uploaded they appear in my sortable list.

I have
success response:

$('<li></li>').appendTo('#sortable').fadeIn('slow').html(re sponse);

page code:
<ul id="sortable" class="files">
<li>image1</li> -> are there when the page loads
<li>image2</li> -> are there when the page loads
<li>image3</li> -> are there when the page loads

<li>image4</li> -> newly added image appears here but I would like it to
appear above image1
</ul>

But I would like to have it appear at the top. What I have adds it to the
very bottom of the list. How can I have it appear at the top of the list?

Thanks


Dave




--
Charlie Griefer
http://charlie.griefer.com/

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.





--
Charlie Griefer
http://charlie.griefer.com/

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.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.