Remove or Change LightBox Active Image

9 posts, 0 answers
  1. Jack
    Jack avatar
    128 posts
    Member since:
    May 2003

    Posted 05 Feb 2014 Link to this post

    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
  2. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 10 Feb 2014 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jack
    Jack avatar
    128 posts
    Member since:
    May 2003

    Posted 10 Feb 2014 in reply to Viktor Tachev Link to this post

    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
  5. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 12 Feb 2014 Link to this post

    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.
  6. Jack
    Jack avatar
    128 posts
    Member since:
    May 2003

    Posted 12 Feb 2014 in reply to Viktor Tachev Link to this post

    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

  7. Philippe Coste
    Philippe Coste avatar
    1 posts
    Member since:
    Sep 2009

    Posted 13 Feb 2014 in reply to Jack Link to this post

    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


  8. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 17 Feb 2014 Link to this post

    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.
  9. Jack
    Jack avatar
    128 posts
    Member since:
    May 2003

    Posted 22 Feb 2014 in reply to Viktor Tachev Link to this post

    Hi Viktor,

    I can't see the sample!

    Cheers,

    Jack
  10. Viktor Tachev
    Admin
    Viktor Tachev avatar
    1488 posts

    Posted 26 Feb 2014 Link to this post

    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.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017