3 Replies - 926 Views - Last Post: 19 July 2011 - 09:19 AM

how to display images with long titles using javascript?

Posted 17 July 2011 - 10:20 AM

Hy all!

m tryig to display titles of more than one word of scrolling images when hover on the images. But there is a problem in my code. It shows only the first word when hover the images. e.g the images title is "My first image" then it will display only 'My' as the title. Is there any option to fix this problem using the javascript.

Re: how to display images with long titles using javascript?

It would help if you showed us the actual code so we can see what you are doing wrong. Don't you think? Post your code and we will take a look. That is our number one rule here, always show your code.

Thanks for helping us help you! :)

This is my code.issue with the Title Display in the scroll bar script. It doesn't show the text
after space but I need to show full title. Need to tweak this js script to make
it work. Look into it to fix.

If you open the file then on mouse over on images you will see title. Right now
only displaying first word as not showing text after space.

Like for the first image title is "A homing pigeon learns to cope with a
learning difficulty with the help of his teacher." But its only showing A.

pic[0] = new banner("images/bgpic_07.jpg",100,"Books_page.php#pigeon")
pic[0].title ="A homing pigeon learns to cope with a learning difficulty with the help of his teacher."

pic[1] = new banner('images/bgpic_09.jpg',100,'Books_page.php#chipperClown')
pic[1].title ="Chipper wants to be a clown more than anything, but in order to make his dream come true, he learns the importance of asking for help."

pic[2] = new banner('images/bgpic_11.jpg',100,'Books_page.php#chipperUnicycle')
pic[2].title ="Chipper finds a new act! But it is harder than he thought. Chipper learns the value of perseverance when learning something new."

pic[3] = new banner('images/bgpic_13.jpg',100,'Books_page.php#shelby')
pic[3].title ="Shelby is a kind and caring cat who will not let the mean street cats bully him into changing."

pic[4] = new banner('images/bgpic_15.jpg',100,'Books_page.php#tortoise')
pic[4].title ="Jake the tortoise wants to fit in, so he changes the way he looks. But he learns that he does not have to do that to find true friends."

pic[5] = new banner('images/bgpic_17.jpg',100,'Books_page.php#cat')
pic[5].title ="An ordinary housecat foils a burglar just by doing what he does best....being a cat."

pic[6] = new banner('images/bgpic_19.jpg',100,'Books_page.php#superhero')
pic[6].title ="Superhero always saves the day! Then he meets two foes he can not beat. But he knows he can always call on his dad for help."

pic[7] = new banner('images/bgpic_21.jpg',100,'Books_page.php#martin')
pic[7].title ="Martin loves to daydream in school. But he learns that paying attention in school is the first step to making those dreams come true."

pic[8] = new banner('images/TwitchCover-s.jpg',100,'Books_page.php#twitch')
pic[8].title ="Twitch is a daredevil…and he always lands on his feet! But he learns that his parents know best about keeping him safe."

pic[9] = new banner('images/bgpic_07.jpg',100,'Books_page.php#pigeon')
pic[9].title ="A homing pigeon learns to cope with a learning difficulty with the help of his teacher."

pic[10] = new banner('images/bgpic_09.jpg',100,'Books_page.php#chipperClown')
pic[10].title ="Chipper wants to be a clown more than anything, but in order to make his dream come true, he learns the importance of asking for help."

pic[11] = new banner('images/bgpic_11.jpg',100,'Books_page.php#chipperUnicycle')
pic[11].title ="Chipper finds a new act! But it is harder than he thought. Chipper learns the value of perseverance when learning something new."