I am attempting to display different content on hover over text, specifically listing various HTTP error codes. My setup includes 3 icons and text that will reveal specific content based on the text hovered over:
success error blocked
Below is the JS code:
$(".icon").on("hover", function(event){
var ele = $(this);
var myindex = $(this).parent().index();
var longlabel = "";
switch (someData[myindex]) {
case "Success": {
longLabel = '200 OK: Standard response for successful HTTP requests'
break;
}
case "Blocked" :{
longLabel = 'Error response Code: 403 Developer is not authorized'
break;
}
case "Error" :{
longLabel = 'Error response codes: 400 Bad request, 404 Not Found, 500 Internal Server Error, 503 Service Unavailable, 504 Gateway Timeout'
break;
}
}
nv.tooltip.show('<p>' + longLabel + '</p>');
});
Currently, I want to display the content as a list when hovering, like this:
Error response codes:
- 400 Bad request
- 404 Not Found
- 500 Internal Server Error
- 503 Service Unavailable
- 504 Gateway Timeout
Instead of the way it is being displayed now:
Does anyone have suggestions on how I can make these codes appear in a vertical list format? Any ideas would be appreciated!