Skip to content

Instantly share code, notes, and snippets.

@cecyurbina
Created February 7, 2014 08:30
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 cecyurbina/8859056 to your computer and use it in GitHub Desktop.
Save cecyurbina/8859056 to your computer and use it in GitHub Desktop.
var content = '';
$('div.carR2').mouseover(function() {
content = $(this).find("font").first().text();
im = $(this).find("a").first().find("img").get(0).outerHTML;
console.log(im);
render_panel();
});
$('div.carR2').mouseout(function() {
console.log("debug");
});
if($('#eco').length!==0){
$('#eco').remove();
$('body').css({
'padding-right': '0px'
});
}
else {
render_panel();
}
function render_panel() {
$('#eco').remove();
var sidebar;
sidebar = $("<div id='eco' class='panel panel-success'><div class='panel-heading'><h4>Asistente de compras verdes</h4></div>"+
"<div class='panel-body bg-success'>"+
"<h5>"+content+"</h5>"+
im+
"</br></br><table class='table'>"+
"<tr>"+
"<td class='active'>Reciclable</td>"+
"<td class='success'>Reutilizable</td>"+
"<td class='danger'>Biodegradable</td>"+
"</tr>"+
"</table>"+
"</div>"+
"<div id='sidebar'></div></div>");
sidebar.css({
'position': 'fixed',
'right': '0px',
'top': '0px',
'z-index': 9999,
'width': '25%',
'height': '100%',
});
$('body').append(sidebar);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment