Rollover / hover showing html from caption
Permalink Browser Info Environment
Hi. I really like your plug-in, but when I hover over a thumbnail, the text from the caption shows with the html. Anyway to fix that? Thanks.
Type: | Discussion |
---|---|
Status: | New |
thanks for the quick response and fix.
It now doesn't show the caption when I rollover the thumbnail, but I want the caption to display the html correctly BOTH when I rollover and when the image is displayed fully.
Now the full image shows the caption with the html code instead of rendering it appropriately.
Please see this link:http://www.irisquilts.com/index.php/quiltgallery/nature/...
and you'll see what I mean.
Thanks again.
It now doesn't show the caption when I rollover the thumbnail, but I want the caption to display the html correctly BOTH when I rollover and when the image is displayed fully.
Now the full image shows the caption with the html code instead of rendering it appropriately.
Please see this link:http://www.irisquilts.com/index.php/quiltgallery/nature/...
and you'll see what I mean.
Thanks again.
It looks like you may have had some customized code in there before which got overwritten during the update (because prior versions didn't allow html in the captions either). Fortunately I just updated the addon (again) with a new feature that lets you enable this -- what you want to do is upgrade your addon to the new new version (1.6) and then add this line of code to your config/site.php file:
define('DELUXE_IMAGE_GALLERY_HTML_CAPTIONS', 1);
thanks! the caption now shows the html correctly. any idea why nothing shows when hovering over the image?
Huh... I misunderstood your original request -- I thought you didn't want those appearing there. The problem is that those little popup things won't show HTML, so the choice is either show them with the html, show them with all of the html tags stripped away (which might make the text not look correct), or not show them at all. I chose what I thought was the lesser of all evils and just removed the display entirely (most people don't like that actually because it gets in the way of the image).
But if you want to add it back with the html tags stripped out you can do so by following these steps:
1) Create a new directory on your server at YOURSITE/blocks/deluxe_image_gallery/ (if it doesn't already exist).
2) Copy this file:
...into that new directory you just created.
3) Edit that new copy of the file and change line #17 from this:
...to this:
I think that's the best we can do -- let me know how it goes.
-Jordan
But if you want to add it back with the html tags stripped out you can do so by following these steps:
1) Create a new directory on your server at YOURSITE/blocks/deluxe_image_gallery/ (if it doesn't already exist).
2) Copy this file:
YOURSITE/packages/deluxe_image_gallery/blocks/deluxe_image_gallery/view.php
...into that new directory you just created.
3) Edit that new copy of the file and change line #17 from this:
...to this:
<a href="<?php echo $img['full_src']; ?>" rel="<?php echo $rel; ?>" title="<?php echo strip_tags($img['caption']); ?>">
I think that's the best we can do -- let me know how it goes.
-Jordan
I got the opposite problem though...
In thumbs view the correct alt-tag is shown but in zoomed view the entire html is shown as hover popup, and I can't get rid of it!
My D.I.G is modified quite a bit and I have added a div with caption information as suggested in an earlier thread in this forum (http://www.concrete5.org/marketplace/addons/deluxe-image-gallery/qu... ).
How can I remove that hideous popup with my html??
In thumbs view the correct alt-tag is shown but in zoomed view the entire html is shown as hover popup, and I can't get rid of it!
My D.I.G is modified quite a bit and I have added a div with caption information as suggested in an earlier thread in this forum (http://www.concrete5.org/marketplace/addons/deluxe-image-gallery/qu... ).
How can I remove that hideous popup with my html??
When you say "popup" do you mean the caption itself, or an additional popup that appears when you hover over the image?
Ok, I might not have been clear in my previous post. Sorry.
The thing is that everything in my caption <div class="deluxe_image_gallery_caption"> (including html) shows as alt tag for the zoomed image.
But as it happens this seems to be an IE8 issue because it behaves somewhat as it should in Chrome. In Chrome, on the other hand, I don't get the desired alt tag on the thumbs.
I am at home at the moment working over VPN on the server so I don't have all the tools I usually do when I'm on my computer at work. Perhaps I will figure it out tomorrow, but if you have any suggestions then please let me know.
Below is some code from view.php
Edit: Nevermind my stupidity... Alt tags are not supposed to show in browsers except in Internet Exploder (which does everything wrong). The correct use of the desired effect should be title="" together with alt="" (alt for alternative text when images cannot be shown). So now it just seems to be an IE issue with the caption (including html) showing up. See attached jpg.
The thing is that everything in my caption <div class="deluxe_image_gallery_caption"> (including html) shows as alt tag for the zoomed image.
But as it happens this seems to be an IE8 issue because it behaves somewhat as it should in Chrome. In Chrome, on the other hand, I don't get the desired alt tag on the thumbs.
I am at home at the moment working over VPN on the server so I don't have all the tools I usually do when I'm on my computer at work. Perhaps I will figure it out tomorrow, but if you have any suggestions then please let me know.
Below is some code from view.php
<?php if ($enableLightbox): ?> <a href="<?php echo $img['full_src']; ?>" rel="<?php echo $rel; ?>"> <?php endif; ?> <?php echo $html->image($img['thumb_src'], $img['thumb_width'], $img['thumb_height'], array('border' => '0', 'alt' => $img['project'])); <?php if ($enableLightbox): ?> </a> <div class="deluxe_image_gallery_caption" style="display: none;"> <span><?php echo $img['client']; ?> - <?php echo $img['project']; ?></span> <br /> <span>Design: <?php echo $img['design']?> - Construction: <?php echo $img['construction']?></span> </div> <?php endif; ?>
Edit: Nevermind my stupidity... Alt tags are not supposed to show in browsers except in Internet Exploder (which does everything wrong). The correct use of the desired effect should be title="" together with alt="" (alt for alternative text when images cannot be shown). So now it just seems to be an IE issue with the caption (including html) showing up. See attached jpg.
Should be able to remove the alt tag then, so change this line:
...to this:
...to this:
Nope, the problem still exists in IE (8 and 9) and I can't figure out why.
It seems IE reads the <div> as alt="" and displays it (as it shouldn't) while every other browser (not tested EVERYONE but still) does not.
It seems IE reads the <div> as alt="" and displays it (as it shouldn't) while every other browser (not tested EVERYONE but still) does not.
OK, I solved it.
I had to edit jquery.fancybox-1.3.4.pack.js to get rid of it. Somewhere in that jungle of code I found:
and replaced it with:
What this does i setting alt="" instead of alt=title, which IE shows on hover.
I had to edit jquery.fancybox-1.3.4.pack.js to get rid of it. Somewhere in that jungle of code I found:
b("<img />").attr({id:"fancybox-img",src:v.src,alt:e.title}).appendTo(m);
and replaced it with:
b("<img />").attr({id:"fancybox-img",src:v.src,alt:""}).appendTo(m);
What this does i setting alt="" instead of alt=title, which IE shows on hover.
I've just updated the addon to address this issue (version 1.05).
Let me know if you run into any problems or have any other questions.
Thanks!
-Jordan