Custom Desk.com Chat Icon

Desk.com doesn’t have very much documentation on their chat widget.

If there is, let me know.

All I needed was a custom icon for the chat button. I had to hack it into place by continually checking to see if the widget has initialized yet. Once it has initialized, hide the desk.com chat icon and attach a click handler to our own button, which merely proxies the click to the hidden original button.

// <a href="http://desk.com">desk.com</a> hack; custom chat now button.
var $chatButton = $(&quot;.my-chat-button&quot;);

var intervalID = setInterval(function() {
$widget = $(&quot;.a-desk-widget&quot;);
if ($widget.length != 0) {
clearInterval(intervalID);
$widget.hide();

$chatButton = $(&quot;.chat-now-button&quot;);

$chatButton.click(function() {
$widget.click();
})
}
})

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s