inherit
140147
0
May 15, 2024 5:30:22 GMT -8
Nscalerr 🐺
Throw me to the wolves and I'll return leading the pack!
3,008
May 2009
nscalerr
|
Post by Nscalerr 🐺 on Jun 1, 2018 23:56:37 GMT -8
Well it basically works, but is picking up the QR box, not the post contents. $(document).ready(function(){ function my_code() { $('.message').each(function(){ if($(this).find('div').length > 0) { var cell_content = $(this).html(); var div = $('<div></div>').html(cell_content).attr('id','side-post').addClass('post-list'); $('#post_list').append(div); } else { var cell_content = $(this).html(); var div = !$('<div></div>').html(cell_content).attr('id','side-post').addClass('post-list'); $('#post_list').append(div); } }); }; $('#run_code').click(function(){ my_code(); }); });
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,290
January 2004
todge
|
Post by Todge on Jun 2, 2018 7:36:33 GMT -8
Well it basically works, but is picking up the QR box, not the post contents. View Attachment$(document).ready(function(){ function my_code() { $('.message').each(function(){ if($(this).find('div').length > 0) { var cell_content = $(this).html(); var div = $('<div></div>').html(cell_content).attr('id','side-post').addClass('post-list'); $('#post_list').append(div); } else { var cell_content = $(this).html(); var div = !$('<div></div>').html(cell_content).attr('id','side-post').addClass('post-list'); $('#post_list').append(div); } }); }; $('#run_code').click(function(){ my_code(); }); }); It is picking up the QR cell because it shares the class-name 'message', you cab stop that by better defining the cells the code is to search for.. Change this line.. $('.message').each(function(){ to this.. $('article > .message').each(function(){ This part of your code is not needed.. You are telling the browser not to create a <div> cell then trying to append it to the post_list cell, just leave the whole 'else' part of the if statement out.
|
|
inherit
140147
0
May 15, 2024 5:30:22 GMT -8
Nscalerr 🐺
Throw me to the wolves and I'll return leading the pack!
3,008
May 2009
nscalerr
|
Post by Nscalerr 🐺 on Jun 2, 2018 22:53:25 GMT -8
|
|
inherit
229600
0
Sept 7, 2022 11:09:51 GMT -8
Ben Goodman
96
February 2016
benhun
|
Post by Ben Goodman on Jun 3, 2018 6:44:53 GMT -8
Hi!
Thank you, but it is not working for me. The button does nothing :/
|
|
inherit
140147
0
May 15, 2024 5:30:22 GMT -8
Nscalerr 🐺
Throw me to the wolves and I'll return leading the pack!
3,008
May 2009
nscalerr
|
Post by Nscalerr 🐺 on Jun 3, 2018 7:34:42 GMT -8
That will be one for Todge to work out, since it was working for me.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,290
January 2004
todge
|
Post by Todge on Jun 3, 2018 8:48:43 GMT -8
We will need to see you forum with the plugin installed to have any chance of finding the problem
|
|
inherit
140147
0
May 15, 2024 5:30:22 GMT -8
Nscalerr 🐺
Throw me to the wolves and I'll return leading the pack!
3,008
May 2009
nscalerr
|
Post by Nscalerr 🐺 on Jun 4, 2018 5:38:04 GMT -8
|
|