The effects of alcohol on sustanon 250 leucine for – real weight loss & bodybuilding benefits?
Changing target HTM...
 
Share:
Notifications
Clear all

[Solved] Changing target HTML # element for comment bubble

7 Posts
2 Users
0 Reactions
616 Views
Posts: 18
Topic starter
(@willgreeny)
Eminent Member
Joined: 3 years ago

Hi there,

The comment bubble is great. However, is there a way to make it target a different HTML? For example, the comments are disabled for people that are logged in and a member (I want the comment bubble to scroll to the HTML element above the comments to explain how to sign up and the benefits of it (such as commenting etc.).

Kind regards,

 

Will

6 Replies
Asti
Posts: 7661
 Asti
Support
(@asti)
Illustrious Member
Joined: 7 years ago

Hi Will,

I'll ask the developers and get back to you once I get a response from them. 

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7661

You should overwrite the JS codes that are added for the id="wpd-bubble".

In other words, this can be reached using the JS codes.

Posts: 18
Topic starter
(@willgreeny)
Eminent Member
Joined: 3 years ago

Thank you - can you provide me the way to actually do this?

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7661

@willgreeny,

You can use this function. If it's necessary you should modify it: 

let $= jQuery; 
$('body').on('click', '#wpd-bubble', function(){ let d = $('#poetry-plus-comments'); if( d.length ){ setTimeout( function(){ $('html').scrollTop( (d.offset().top - 100) ) }, 1000 )  } } );
Posts: 18
Topic starter
(@willgreeny)
Eminent Member
Joined: 3 years ago

Hello,

I implemented this on the page, but unfortunately it does not seem to work?

1 Reply
Asti
 Asti
Support
(@asti)
Joined: 7 years ago

Illustrious Member
Posts: 7661

The code should work fine. We've checked it one more time.

Please check out this article: https://www.wpbeginner.com/wp-tutorials/how-to-easily-add-javascript-in-wordpress-pages-or-posts/

Share: