[jQuery] Re: SlideToggle a DIV inside another DIV
Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the edit buttons are clicked all of the gb_edit DIV's appear (shown below). Please Help! JQuery Code: script type=text/javascript $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(.gb_edit).slideToggle(); }); }); /script div class=gb_results pRESULTS DISPLAYED HERE/p a href=# class=editEdit/a div class=gb_edit pEDIT CONTENT IN HERE/p /div /div
[jQuery] Re: SlideToggle a DIV inside another DIV
try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the edit buttons are clicked all of the gb_edit DIV's appear (shown below). Please Help! JQuery Code: script type=text/javascript $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(.gb_edit).slideToggle(); }); }); /script div class=gb_results pRESULTS DISPLAYED HERE/p a href=# class=editEdit/a div class=gb_edit pEDIT CONTENT IN HERE/p /div /div
[jQuery] Re: SlideToggle a DIV inside another DIV
ok try this $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().child(.guestbook_edit).slideToggle(); }); StoneGut wrote: Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the edit buttons are clicked all of the gb_edit DIV's appear (shown below). Please Help! JQuery Code: script type=text/javascript $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(.gb_edit).slideToggle(); }); }); /script div class=gb_results pRESULTS DISPLAYED HERE/p a href=# class=editEdit/a div class=gb_edit pEDIT CONTENT IN HERE/p /div /div
[jQuery] Re: SlideToggle a DIV inside another DIV
No Go - thought that would do it though ... looks like it SHOULD work. On Dec 8, 11:30 am, Liam Potter [EMAIL PROTECTED] wrote: ok try this $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().child(.guestbook_edit).slideToggle(); }); StoneGut wrote: Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the edit buttons are clicked all of the gb_edit DIV's appear (shown below). Please Help! JQuery Code: script type=text/javascript $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(.gb_edit).slideToggle(); }); }); /script div class=gb_results pRESULTS DISPLAYED HERE/p a href=# class=editEdit/a div class=gb_edit pEDIT CONTENT IN HERE/p /div /div
[jQuery] Re: SlideToggle a DIV inside another DIV
my mistake, should of been child should be chilren $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children(.guestbook_edit).slideToggle(); }); StoneGut wrote: No Go - thought that would do it though ... looks like it SHOULD work. On Dec 8, 11:30 am, Liam Potter [EMAIL PROTECTED] wrote: ok try this $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().child(.guestbook_edit).slideToggle(); }); StoneGut wrote: Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the edit buttons are clicked all of the gb_edit DIV's appear (shown below). Please Help! JQuery Code: script type=text/javascript $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(.gb_edit).slideToggle(); }); }); /script div class=gb_results pRESULTS DISPLAYED HERE/p a href=# class=editEdit/a div class=gb_edit pEDIT CONTENT IN HERE/p /div /div
[jQuery] Re: SlideToggle a DIV inside another DIV
Still nothing Liam - thanks so much for your help. It's greatly appreciated!! I'm removing all the (this).parent().children just to check the the links are all working fine and they are - but - ALL the guesetbook_edit DIV's are opening - with your code in place nothing happens. No DIV movement. On Dec 8, 11:53 am, Liam Potter [EMAIL PROTECTED] wrote: my mistake, should of been child should be chilren $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children(.guestbook_edit).slideToggle(); }); StoneGut wrote: No Go - thought that would do it though ... looks like it SHOULD work. On Dec 8, 11:30 am, Liam Potter [EMAIL PROTECTED] wrote: ok try this $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().child(.guestbook_edit).slideToggle(); }); StoneGut wrote: Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the edit buttons are clicked all of the gb_edit DIV's appear (shown below). Please Help! JQuery Code: script type=text/javascript $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(.gb_edit).slideToggle(); }); }); /script div class=gb_results pRESULTS DISPLAYED HERE/p a href=# class=editEdit/a div class=gb_edit pEDIT CONTENT IN HERE/p /div /div
[jQuery] Re: SlideToggle a DIV inside another DIV
i just noticed all the font tags (you will want to remove these, the font tag is no longer used) so it would of been getting that as the parent, this one should work. $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parents(guestbook_result).children(.guestbook_edit).slideToggle(); }); StoneGut wrote: Still nothing Liam - thanks so much for your help. It's greatly appreciated!! I'm removing all the (this).parent().children just to check the the links are all working fine and they are - but - ALL the guesetbook_edit DIV's are opening - with your code in place nothing happens. No DIV movement. On Dec 8, 11:53 am, Liam Potter [EMAIL PROTECTED] wrote: my mistake, should of been child should be chilren $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children(.guestbook_edit).slideToggle(); }); StoneGut wrote: No Go - thought that would do it though ... looks like it SHOULD work. On Dec 8, 11:30 am, Liam Potter [EMAIL PROTECTED] wrote: ok try this $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().child(.guestbook_edit).slideToggle(); }); StoneGut wrote: Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the edit buttons are clicked all of the gb_edit DIV's appear (shown below). Please Help! JQuery Code: script type=text/javascript $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(.gb_edit).slideToggle(); }); }); /script div class=gb_results pRESULTS DISPLAYED HERE/p a href=# class=editEdit/a div class=gb_edit pEDIT CONTENT IN HERE/p /div /div
[jQuery] Re: SlideToggle a DIV inside another DIV
Font tag is no longer used ?? I never got that email. LOL It worked! BUT I didn't have to remove the font tag. Seems like a few posts ago you figured it out but left out an s: $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children (.guestbook_edit).slideToggle(); I replaced parent() with parents() and now it works perfectially!! Thank you so much - I'm after posting this problem on numerous sites with no help even given. If you ever need some graphical work done just hit me up. VERY grateful, -=Neil=- On Dec 8, 12:05 pm, Liam Potter [EMAIL PROTECTED] wrote: i just noticed all the font tags (you will want to remove these, the font tag is no longer used) so it would of been getting that as the parent, this one should work. $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parents(guestbook_result).children(.guestbook_edit).slideToggle(); }); StoneGut wrote: Still nothing Liam - thanks so much for your help. It's greatly appreciated!! I'm removing all the (this).parent().children just to check the the links are all working fine and they are - but - ALL the guesetbook_edit DIV's are opening - with your code in place nothing happens. No DIV movement. On Dec 8, 11:53 am, Liam Potter [EMAIL PROTECTED] wrote: my mistake, should of been child should be chilren $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children(.guestbook_edit).slideToggle(); }); StoneGut wrote: No Go - thought that would do it though ... looks like it SHOULD work. On Dec 8, 11:30 am, Liam Potter [EMAIL PROTECTED] wrote: ok try this $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().child(.guestbook_edit).slideToggle(); }); StoneGut wrote: Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only thing I can accomplish is if any of the edit buttons are clicked all of the gb_edit DIV's appear (shown below). Please Help! JQuery Code: script type=text/javascript $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(.gb_edit).slideToggle(); }); }); /script div class=gb_results pRESULTS DISPLAYED HERE/p a href=# class=editEdit/a div class=gb_edit pEDIT CONTENT IN HERE/p /div /div
[jQuery] Re: SlideToggle a DIV inside another DIV
Graphical work is my best skill so probably won't need that ;) No probs, but yeah, font tags are a no no these day, the way you are using them right now you could just put the class on the a tag itself, then the multiple br / tags could be replaced for adding margins into the css. Good luck with your project. StoneGut wrote: Font tag is no longer used ?? I never got that email. LOL It worked! BUT I didn't have to remove the font tag. Seems like a few posts ago you figured it out but left out an s: $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children (.guestbook_edit).slideToggle(); I replaced parent() with parents() and now it works perfectially!! Thank you so much - I'm after posting this problem on numerous sites with no help even given. If you ever need some graphical work done just hit me up. VERY grateful, -=Neil=- On Dec 8, 12:05 pm, Liam Potter [EMAIL PROTECTED] wrote: i just noticed all the font tags (you will want to remove these, the font tag is no longer used) so it would of been getting that as the parent, this one should work. $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parents(guestbook_result).children(.guestbook_edit).slideToggle(); }); StoneGut wrote: Still nothing Liam - thanks so much for your help. It's greatly appreciated!! I'm removing all the (this).parent().children just to check the the links are all working fine and they are - but - ALL the guesetbook_edit DIV's are opening - with your code in place nothing happens. No DIV movement. On Dec 8, 11:53 am, Liam Potter [EMAIL PROTECTED] wrote: my mistake, should of been child should be chilren $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children(.guestbook_edit).slideToggle(); }); StoneGut wrote: No Go - thought that would do it though ... looks like it SHOULD work. On Dec 8, 11:30 am, Liam Potter [EMAIL PROTECTED] wrote: ok try this $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().child(.guestbook_edit).slideToggle(); }); StoneGut wrote: Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or
[jQuery] Re: SlideToggle a DIV inside another DIV
True enough - I'll make the adjustments to this project and to that part of my brain for future use. Thanks again! On Dec 8, 12:21 pm, Liam Potter [EMAIL PROTECTED] wrote: Graphical work is my best skill so probably won't need that ;) No probs, but yeah, font tags are a no no these day, the way you are using them right now you could just put the class on the a tag itself, then the multiple br / tags could be replaced for adding margins into the css. Good luck with your project. StoneGut wrote: Font tag is no longer used ?? I never got that email. LOL It worked! BUT I didn't have to remove the font tag. Seems like a few posts ago you figured it out but left out an s: $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children (.guestbook_edit).slideToggle(); I replaced parent() with parents() and now it works perfectially!! Thank you so much - I'm after posting this problem on numerous sites with no help even given. If you ever need some graphical work done just hit me up. VERY grateful, -=Neil=- On Dec 8, 12:05 pm, Liam Potter [EMAIL PROTECTED] wrote: i just noticed all the font tags (you will want to remove these, the font tag is no longer used) so it would of been getting that as the parent, this one should work. $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parents(guestbook_result).children(.guestbook_edit).slideToggle(); }); StoneGut wrote: Still nothing Liam - thanks so much for your help. It's greatly appreciated!! I'm removing all the (this).parent().children just to check the the links are all working fine and they are - but - ALL the guesetbook_edit DIV's are opening - with your code in place nothing happens. No DIV movement. On Dec 8, 11:53 am, Liam Potter [EMAIL PROTECTED] wrote: my mistake, should of been child should be chilren $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().children(.guestbook_edit).slideToggle(); }); StoneGut wrote: No Go - thought that would do it though ... looks like it SHOULD work. On Dec 8, 11:30 am, Liam Potter [EMAIL PROTECTED] wrote: ok try this $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).parent().child(.guestbook_edit).slideToggle(); }); StoneGut wrote: Didn't work - thanks though - tried the whole SIBLING thing as well before. I simplefied my code example for the post -- here is that section in whole: script type=text/javascript $(document).ready(function() { $(.guestbook_result .btn-edit).click(function(){ $(this).sibling(.guestbook_edit).slideToggle(); }); }); /script div class=guestbook_result style=background-color:#f7f7f7; border: 1px solid #c1c1c1; width:630px; margin-top:10px; float:left; padding: 4px; onMouseOver=this.style.backgroundColor='#f1f1f1'; this.style.borderColor='#579e18'; onMouseOut=this.style.backgroundColor='#f7f7f7';this.style.borderColor='#c1c1c1'; font class=guestbook_name?php echo $name; ?/fontfont class=guestbook_location from ?php echo $location; ?/fontbr / div style=padding-left:15px;font class=guestbook_comment? php echo $comment; ?/font/div div style=text-align:right;font class=guestbook_date? php echo $date; ?/font/div div style=border-top:1px dashed #CCC; text-align:left; padding-top:5px; margin-top:4px; width:630px; font class=main_texta href=admin_guestbook.php? action=approveamp;id=?php echo $id; ?Approve/a | a href=# class=btn-editEdit/a | a href=admin_guestbook.php? action=deleteamp;id=?php echo $id; ? onclick=return confirm ('CONFIRM DELETION - THIS CAN NOT BE UN-DONE')Delete/a/font /div div class=guestbook_edit style=background- color:#CCC; width:600px;display:none; font class=main_textbr /TESTbr /br /?php echo $comment; ? br /br //font /div!--GUESTBOOK EDIT-- /div !--Entry container-- On closer inspection it seems my EDIT link is within another DIV (for formatting and positioning) --- ack! On Dec 8, 11:10 am, Liam Potter [EMAIL PROTECTED] wrote: try this $(document).ready(function() { $(.gb_result .btn-edit).click(function(){ $(this).sibling(.gb_edit).slideToggle(); }); }); StoneGut wrote: Hello, I have a div (gb_results) that includes another div (gb_edit) - when a button with class edit in the gb_results DIV is click I need the gb_edit DIV to toggle in / out. The only thing is that the gb_results DIV is generated dynamically through a database query so I can't name each one as if they were static. I'm tearing my hair out using different variations of THIS or NEXT or FIND and not of them work. The only