none
SharePoint 2010 not displaying alt or description text when mouse hovers over image

    Question

  • We have recently upgraded to SharePoint 2007 to SharePoint 2010.  I have noticed a change that I am not sure is a feature or bug.

    I have several image libraries where staff images are stored and displayed in the thumbnail format.  In SP 2007 when you hovered over the image the text that was in the Description field of the the image would be displayed as the alt text, in the same vein the Alternate Text that you placed in the image properties box would be, as expected, displayed when your mouse hovered over an image.

    SP 2010 does not seem to display the alt text or description text.  I have tried this in IE8 and FireFox. The one exception to this is where I have hand coded some html using an external editor.  That does not account for the problem with image libraries and the description text...?

    I am curious if this is happening to anyone else? 

    Thanks

    Scott

    Tuesday, January 25, 2011 1:00 PM

Answers

  • I encountered the same problem, it seems that the values of the alt and AlternateText  attributes are ignored.

    The solution was to use alternative attributes on the controls.

    For the HTML img control you should use the title attribute, and for server controls, use the ToolTip attribute.

    Hope this helps.

     

    • Proposed as answer by SMoxon Friday, January 28, 2011 8:05 AM
    • Marked as answer by Wayne Fan Thursday, February 03, 2011 2:02 AM
    Friday, January 28, 2011 7:48 AM

All replies

  • I encountered the same problem, it seems that the values of the alt and AlternateText  attributes are ignored.

    The solution was to use alternative attributes on the controls.

    For the HTML img control you should use the title attribute, and for server controls, use the ToolTip attribute.

    Hope this helps.

     

    • Proposed as answer by SMoxon Friday, January 28, 2011 8:05 AM
    • Marked as answer by Wayne Fan Thursday, February 03, 2011 2:02 AM
    Friday, January 28, 2011 7:48 AM
  • I will have a look at this and see what I can make  work.  The difficulty for some is that the picture library uses predefined fields in a form where Description is the text that drives the hover over.

    Thanks for the reply.  It seems to me that MS has lost the plot on one or two things in SP2010 - while I am very happy with some of the changes other changes seem to be causing real grief.

     

    Scott


    Scott Gerber
    Friday, January 28, 2011 10:29 AM
  • I encountered the same problem, it seems that the values of the alt and AlternateText  attributes are ignored.

    The solution was to use alternative attributes on the controls.

    For the HTML img control you should use the title attribute, and for server controls, use the ToolTip attribute.

    Hope this helps.

     


    This is the problem description not the solution, there is no setting or attributes called Title or Tool Tip in SharePoint 2010 to ask end users to fill it (especially when the add images to articles - OOB not Through code). and many clients ask me, they want to show the tool tip when mouse over the image. and the editor in Ribbon Menu allow you only to enter the ALT text.  

    So, i make a jQuery code to work around the problem. The code iterate through <img> tag, and get the alt text (if exist) from the image and add title attribute with the entered alt text, So when you mouse over the image, the tool tip will be shown and it is the alt text also.

    $(document).ready(function() {	
    	
    	$('img').each(function(index) {
    		var altText = $(this).attr('alt');
    		if(altText != "")
    		{
    			$(this).attr('title',altText );
    		}
        	
    	});
    
    });
    
    

     

     

     

    You can insert this code in the master page or page layout or any custom .js file.

    Hope this helps.

    Sunday, January 15, 2012 8:37 PM
  • I agree that Ali's response is the real answer here.  It worked for me.

    Make sure Jquery is installed on your SP server, add a CEWP and Ali's code and the image files will show the alt tags in SP 2010.

    Monday, October 15, 2012 5:50 PM