inherit
213580
0
Sept 27, 2020 2:58:23 GMT -8
counselor
63
September 2014
counselor
|
Post by counselor on Jan 10, 2016 15:01:10 GMT -8
docandkatiesxanadu.freeforums.net/I have been using the following code and inserting it into the HTML editor at the top of the page to jump to the last post in a thread, some of which are VERY long. I tried getting the same code that works very well with other widgets to work with the Bookmarked Threads widget and cannot get it to function at all. Any thoughts... <script type="text/javascript"> $(document).ready(function(){ $('.widget-bookmarked-threads_posts .thread-link').each(function(){ var thread = $(this).attr('class').match(/thread-\d+/g); if(thread.length) $(this).attr('href','/thread/last/'+thread[0].split('-')[1]); }); }); </script>
|
|
#eb7100
33409
0
1
Mar 27, 2024 18:49:16 GMT -8
Brian
48,128
November 2004
smashmaster3
|
Post by Brian on Jan 10, 2016 15:19:53 GMT -8
Hi, counselor. Try changing the code you're currently using on the forum to this: This should handle both using the same code.
|
|
inherit
213580
0
Sept 27, 2020 2:58:23 GMT -8
counselor
63
September 2014
counselor
|
Post by counselor on Jan 10, 2016 15:23:32 GMT -8
Perfect! Just curious ... What did I have wrong?
|
|
#eb7100
33409
0
1
Mar 27, 2024 18:49:16 GMT -8
Brian
48,128
November 2004
smashmaster3
|
Post by Brian on Jan 10, 2016 15:36:15 GMT -8
Your selector targeted the class of an element that did not exist:
Whereas the following two are the proper classes of both elements:
|
|
inherit
213580
0
Sept 27, 2020 2:58:23 GMT -8
counselor
63
September 2014
counselor
|
Post by counselor on Jan 10, 2016 15:48:09 GMT -8
Thanks! It actually looks like what I had originally coded and then when it did not work right, I started "playing".
Again, the assist is much appreciated!
|
|