[Plugin: Javascript Chat for WordPress] Javascript Chat Plutin Fixes (autoscroll, date/time)
-
This is really a great, lightweight chat plugin and it deserves more credit. I’ve modified it a bit to suit my site’s needs and I’ll share a couple of fixes.
Autoscrolling the box was built in, but broke with newer versions of wordpress with jquery 1.6 and above. To fix this, edit the /javascript/wp_jschat.js file and change line 29 to:
t.find('.wp_jschat_widget_text').prop({scrollTop: t.find('.wp_jschat_widget_text').prop('scrollHeight')});
the “attr” tag is depreciated and “prop” replaces the functionality.To make it really fancy, you can stick in the animate function to make it slowly scroll and look like you paid money for the plugin or something by replacing line 29 with this:
t.find('.wp_jschat_widget_text').animate({scrollTop: t.find('.wp_jschat_widget_text').prop('scrollHeight')}, 3000);
To add in a time and date(just as part of the message, not grabbing from the db… cause I’m lazy), change the submit function on about line 49-78 to this:
[Code moderated as per the Forum Rules. Please use the pastebin]
Hope this helps…
https://www.ads-software.com/extend/plugins/javascript-chat-for-wordpress/
- The topic ‘[Plugin: Javascript Chat for WordPress] Javascript Chat Plutin Fixes (autoscroll, date/time)’ is closed to new replies.