This is a migrated thread and some comments may be shown as answers.

Remove or Change LightBox Active Image

8 Answers 145 Views
LightBox
This is a migrated thread and some comments may be shown as answers.
Jon
Top achievements
Rank 1
Jon asked on 05 Feb 2014, 06:34 PM
Hi,

I'm getting the data from the database. When I hover over each image, it has a tooltip of 'LightBox Active Image'
How can I remove that or at least change it please?

Cheers,
Jack

8 Answers, 1 is accepted

Sort by
0
Viktor Tachev
Telerik team
answered on 10 Feb 2014, 12:16 PM
Hi Jack,

In order to modify the tooltip that is displayed when you hover an image you could set the ToolTip property of RadLightBox. If you prefer to have no tooltip you could remove the property altogether or set it as an emplty string.

Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Jon
Top achievements
Rank 1
answered on 10 Feb 2014, 12:24 PM
Hi Viktor,

Of course that's the first thing I tried but removing the property or stating 'ToolTip=""'  both popup the same message ('LightBox Active Image'), for me at least.

Cheers,

Jack
0
Viktor Tachev
Telerik team
answered on 12 Feb 2014, 02:33 PM
Hello Jack,

I managed to replicate the behavior you are describing. It seems that it is observed only in Internet Explorer 7. The browser shows the alt attribute of the image as tooltip. In order to prevent this you could use JavaScript and set the alt attribute of the active image to empty string. I used the OnShowed client event of RadLightBox for changing the attribute. The approach seems to work as expected on my end.

if (typeof document.getElementsByClassName != 'function') {
    document.getElementsByClassName = function () {
        var elms = document.getElementsByTagName('*');
        var ei = new Array();
        for (i = 0; i < elms.length; i++) {
            if (elms[i].getAttribute('class')) {
                ecl = elms[i].getAttribute('class').split(' ');
                for (j = 0; j < ecl.length; j++) {
                    if (ecl[j].toLowerCase() == arguments[0].toLowerCase()) {
                        ei.push(elms[i]);
                    }
                }
            } else if (elms[i].className) {
                ecl = elms[i].className.split(' ');
                for (j = 0; j < ecl.length; j++) {
                    if (ecl[j].toLowerCase() == arguments[0].toLowerCase()) {
                        ei.push(elms[i]);
                    }
                }
            }
        }
        return ei;
    }
}
 
function showedImage(sender, args) {
    var activeImage = document.getElementsByClassName('rltbActiveImage')[0];
    activeImage.alt = "";
}

Note that getElementsByClassName() is not defined in IE 7 and you need to define it manually.

Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Jon
Top achievements
Rank 1
answered on 12 Feb 2014, 05:11 PM
Hi Viktor,

Thank you.
It happens in all the modern browsers for me - are we talking about the same thing?
When the lightbox opens, the image shown has the tooltip as described above.
I can change it in the tooltip property but want to have no tooltip if possible.
Please see attached.

Cheers,

Jack

0
Philippe Coste
Top achievements
Rank 1
answered on 13 Feb 2014, 05:52 PM
Hi Jack, Viktor,

I have the same problem, with all browsers too. I guess it's a small bug using radToolTipManager and radLightBox.
Actually if you look at the HTML of the page the "LightBox Active Image" tooltip is not on the image alt attribute, but in the radToolTipWrapper (<td class="rtWrapperContent" valign="top"><div>LightBox Active Image</div></td>).

Viktor, is there a way to fix this ?

Thanks,

Philippe


0
Viktor Tachev
Telerik team
answered on 17 Feb 2014, 12:28 PM
Hi Jack,

I have prepared a sample project that seems to be working as expected on my side. There is no ToolTip for the images in RadLightBox. Would you run the attached sample and let me know what is different in your setup? What should be changed in the project in order for the problem to be observed? You could also open a formal support ticket and send us the project with the modifications as attachment.

Philippe, could you open a support ticket and send us a runnable project where the issue is observed? This would allow us to investigate the problem locally and look for the cause.


Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
0
Jon
Top achievements
Rank 1
answered on 22 Feb 2014, 09:12 AM
Hi Viktor,

I can't see the sample!

Cheers,

Jack
0
Viktor Tachev
Telerik team
answered on 26 Feb 2014, 12:22 PM
Hi Jack,

I am sending the sample project again. You should see it as attachment to this post. Download the archive and extract it. You need to open the project as a WebSite in Visual Studio. Note that before running the project you need to add the Telerik.Web.UI.dll assembly file to its Bin folder.

After running the site you should see a button on the page. When you click it the RadLightBox will show the images.

Regards,
Viktor Tachev
Telerik
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the UI for ASP.NET AJAX, subscribe to the blog feed now.
Tags
LightBox
Asked by
Jon
Top achievements
Rank 1
Answers by
Viktor Tachev
Telerik team
Jon
Top achievements
Rank 1
Philippe Coste
Top achievements
Rank 1
Share this question
or