Skip to content

Instantly share code, notes, and snippets.

@dangerouse
Last active August 29, 2015 13:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dangerouse/9375948 to your computer and use it in GitHub Desktop.
Save dangerouse/9375948 to your computer and use it in GitHub Desktop.
CloudSponge Widget Reference - Custom Close Button
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-type" content="text/html; charset=utf-8">
<title>custom-close</title>
<style type="text/css" media="screen">
/*
change the background image of the close link
TODO: update this url to reference your custom close button
*/
#fbBox #fbClose.fb.fb_white {
background-image: url(/samples/close.png);
}
</style>
</head>
<body>
<p>
<a class="cs_import">Add from address book</a>
</p>
<script type='text/javascript'>
// Asynchronously include the widget library.
// TODO: Replace the widget_script with valid value
(function(u){
var d=document,s='script',a=d.createElement(s),m=d.getElementsByTagName(s)[0];
a.async=1;a.src=u;m.parentNode.insertBefore(a,m);
})('//api.cloudsponge.com/widget/YOUR_WIDGET_SCRIPT.js');
window.csPageOptions = {
// implement the afterLaunch callback to adjust the size and
// position of the button before it gets rendered
afterLaunch: function(){
$('#fbtrPanel').css({
// offsets the button to the outside of the widget frame
right: '-20px', top: '-20px',
// matches the height of the new close button
height: '29px'
});
$('#fbClose').css({
// match the size of the new close button
height: '29px', width: '29px'
});
}
};
</script>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment