Ok, I'm using a javascript piece called Captify. It adds a small popup to the images for you with text. Works great in all browsers accepting IE9. IE9 all disappears in a popup div. I read its problem with the child, but I cannot fix it. Since the capture can no longer be found anywhere online, I will include all the code for it along with css lower than the code on my page. If someone could help me stop the disappearance, I would be very grateful, as this caused serious problems.
Java
jQuery.fn.extend({
captify: function(o){
var o = $.extend({
speedOver: 'fast',
speedOut: 'normal',
hideDelay: 500,
animation: 'fade',
prefix: '',
className: 'caption'
}, o);
$(this).each(function(){
var img = this;
$(this).load(function(){
$this = img;
if (this.hasInit){
return false;
}
this.hasInit = true;
var over_caption = false;
var over_img = false;
var captionLabelSrc = $('#' + $(this).attr('rel'));
var captionLabelTitle = !captionLabelSrc.length ? $(this).attr('title') : captionLabelSrc.html();
var captionLabelHTML = !captionLabelTitle.length ? $(this).attr('alt') : captionLabelTitle;
captionLabelSrc.remove();
var toWrap = this.parent && this.parent.tagName == 'a' ? this.parent : $(this);
var wrapper = toWrap.wrap('<div></div>').parent();
wrapper.css({
overflow: 'hidden',
padding: 0,
fontSize: 0.1
})
wrapper.addClass('caption-wrapper');
wrapper.width($(this).width());
wrapper.height($(this).height());
$.map(['top','right','bottom','left'], function(i){
$.map(['style','width','color'], function(j){
var key = 'border-'+i+'-'+j;
wrapper.css(key, $(img).css(key));
});
});
$(img).css({border: '0 none'});
$.map(['top','right','bottom','left'], function(t){
var key = 'margin-'+t;
wrapper.css(key, $(img).css(key));
});
var caption = $('div:last', wrapper.append('<div></div>')).addClass(o.className);
var captionContent = $('div:last', wrapper.append('<div></div>')).addClass(o.className).append(o.prefix).append(captionLabelHTML);
$('*',wrapper).css({margin: 0}).show();
var captionPositioning = jQuery.browser.msie ? 'static' : 'relative';
caption.css({
zIndex: 1,
position: captionPositioning
});
captionContent.css({
position: captionPositioning,
zIndex: 2,
background: 'none',
border: '0 none',
opacity: 1.0
});
caption.width(captionContent.outerWidth());
caption.height(captionContent.outerHeight());
captionContent.css({ 'marginTop': -caption.outerHeight() });
var cHide = function(){
if (!over_caption && !over_img)
caption.animate({ marginTop: 0 }, o.speedOut);
};
$(this).hover(
function(){
over_img = true;
if (!over_caption) {
caption.animate({
marginTop: -caption.height()
}, o.speedOver);
}
},
function(){
over_img = false;
window.setTimeout(cHide, o.hideDelay);
}
);
$('div', wrapper).hover(
function(){ over_caption = true; },
function(){ over_caption = false; window.setTimeout(cHide, o.hideDelay); }
);
});
if (this.complete || this.naturalWidth > 0){
$(img).trigger('load');
}
});
}
});
CSS now for grabbing
.caption {
color: #ffffff;
padding: 0.6em;
font-size: 10px;
display: none;
cursor: default;
background: #000000;
opacity: 0.7;
filter: alpha(opacity=70);
-moz-opacity: 0.7;
-khtml-opacity: 0.7;
margin-bottom: 5px;
}
.caption a {
border: 0 none;
text-decoration: none;
background: #000000;
padding: 0.3em;
color:#FFFF00;
}
.caption a:hover {
text-decoration:underline;
}
.caption-wrapper {
float: left;
}
br.c { clear: both; }
now my page
<link href="/js/captify/sample.css" rel="stylesheet" type="text/css" /><script type="text/javascript" src="/js/captify/captify.js"></script>
<script type="text/javascript">
$(document).ready(function(){
$('img.captify').captify({
speedOver: 150,
speedOut: 200,
hideDelay: 100,
animation: 'fade',
prefix: '',
className: 'caption'
});
});
</script>
<div id="services">
<ul >
<li >
<img src="/images/sports.png" width="169" height="121" class="captify" rel="caption1" />
<div id="caption1"><h4>Watersports</h4>
<p>View all the sports we offer on the lakeside.</p></div>
</li></ul></div>
and additional css i use
#services {
width: 570px;
margin-top: 370px;
height: 130px;
}
#services ul li {
float: left;
height: 128px;
width: 184px;
margin-right: 5px;
}