A few month back I posted a question about how to show the caption when hovering over an image.
This is the thread:
Don't understand how to show the caption when hovering image
The issue is that when I used TinyMce to edit the caption, it won’t show the caption hovering. Instead it doesn’t show any caption, it just hovers.
This is editor side (I shortened it):
<script language="javascript" type="text/javascript">//<![CDATA[
tinyMCE.init({
// General options
mode: "textareas",
elements : "ajaxfilemanager",
theme : "advanced",
});
//]]</script>
This is output:
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
<style>
#caption { display: none;font:12px Times New Roman;}
img:hover + #caption { position: absolute; display: block;}
.caption { display:none; text-decoration: none; font:12px Times New Roman;}
.image-with-caption:hover .caption {display: block; text-decoration: none;}
a:hover { text-decoration: none; }
</style>
<table width="100%">
<tr>
<td>
<?php echo(stripslashes($_POST['content'])); ?>
</td>
</tr>
</table>
</body>
</html>
This is the input I copy and paste the code into TinyMCE:
<table width="100%">
<tr>
<td>
<div class="image-with-caption">
<a href="images/artistc.php">
<img src="images/imagec08.jpg" style="width:209px" />
<p id="caption">Caption 3</p>
</a>
</div>
</td>
<td>
<div class="image-with-caption">
<a href="images/artistb.php">
<img src="images/imageb12.jpg" style="width:195px" />
<p id="caption">Caption 5</p>
</a>
</div>
</td>
<td>
<div class="image-with-caption">
<a href="images/artista.php">
<img src="images/imagea02.jpg" style="width:260px" />
<p id="caption">Caption 4</p>
</a>
</div>
</td>
</tr>
</table>
Any suggestions and advice would be appreciated. I just want to know why it doesn’t show the caption.
I don’t completely understand your question, but I see you have several tags with same id. That is not allowed. Maybe if you fix that, it helps to fix the issue. You should replace the
id="caption"byclass="caption"(or anything else), and then, modify your css replacing#captionby.caption