Created
February 7, 2014 08:30
-
-
Save cecyurbina/8859056 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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