homepage Welcome to WebmasterWorld Guest from 54.198.42.105
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
Disable tool tips on all elements
andrewsmd




msg:4451996
 9:37 pm on May 10, 2012 (gmt 0)

I'm working in a CMS system that is auto generating the html for me. The problem is, it generates alt="Picture" for every image. I don't want a tool tip at all. Is there a way I can get the image tag within the div and remove the tool tip? Every image tag is within a span like so

<span class="bioImage">
<img alt="Picture" title="Picture" src="/Portals/0/staffPics/Angela-Jones,-PT,-ATC.jpg">
</span>
<span class="bioImage">
<img alt="Picture" title="Picture" src="/Portals/0/staffPics/Angela-Jones,-PT,-ATC.jpg">
</span>
<span class="bioImage">
<img alt="Picture" title="Picture" src="/Portals/0/staffPics/Angela-Jones,-PT,-ATC.jpg">
</span>


I already have a class where I can get each one of those span objects, I just need someway to get the image object within there and set the title to "" or disable it. Any ideas? Thanks,

 

rainborick




msg:4452000
 9:43 pm on May 10, 2012 (gmt 0)

You could certainly use JavaScript to set the alt and title attributes of these tags to '', so the vast majority of users wouldn't see them. Install an onload() function that collects all of the <img> tags with document.getElementsByTagName('img'), and for each element in the resulting array, check if the alt's and title's == "Picture" and if so, set them to ''.

Beyond that, the only solution would be to dig into the CMS' scripts and change the relevant code.

andrewsmd




msg:4452003
 9:49 pm on May 10, 2012 (gmt 0)

I had thought about pulling all the image tags but didn't want to set every single one. Never thought of checking what the title was and basing it on that. Thanks for the idea. I'll post the code when I finish it.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved