LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-06-2011, 12:33 AM   #1
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Rep: Reputation: 52
onMouseOver question


I have hundreds of thumbnail images and I need to display on the client side one name only for each when the visitor passes the mouse over them. The only way I know (using frames in this case) is to use a script similar to the following:

<a href="" target="" onMouseOver='top.nav3.location="not/notecome.htm"' onMouseOut='top.nav3.location="nav.htm"'>

But this involves creating a full and w3c correct HTML document which looks like an over-kill of the problem.

Is there a simpler way to solve the problem? If not, is it acceptable to use a truncated HTML document comprising only the necessary tags to make it work on the test machine (<html><body><.....onMouseOver.....></body><?html>

Or a way to display the content of the "alt" tag (I can put that name there)?

In the worst case, I could use the javascript "Alert" but it does not fit esthetically and it needs one mouse click from the visitor. Is it possible to make one's own "Alert" picture and how?

Any help or hint most appreciated.

Thank you for your help.

Last edited by rblampain; 01-06-2011 at 12:44 AM.
 
Old 01-06-2011, 01:36 AM   #2
paulsm4
LQ Guru
 
Registered: Mar 2004
Distribution: SusE 8.2
Posts: 5,863
Blog Entries: 1

Rep: Reputation: Disabled
Depending on whether or not you have access to the server - and you're comfortable with PHP - you might be interested in "phpThumb":

http://phpthumb.sourceforge.net/
 
Old 01-06-2011, 02:11 AM   #3
Guttorm
Senior Member
 
Registered: Dec 2003
Location: Trondheim, Norway
Distribution: Debian and Ubuntu
Posts: 1,453

Rep: Reputation: 446Reputation: 446Reputation: 446Reputation: 446Reputation: 446
Hi

If you want to code it yourself, you can also change the page on the fly with innerHTML. First you need to make a div somewhere:

Code:
<div id="nameDiv"></div>
Then you set the content of the div with some Javascript:
Code:
function displayName(name) {
  document.getElementById("nameDiv").innerHTML = name;
}
You can pass text or html to this function and it will be displayed inside the <div> tag.

If you only want names of pictures, you can also use the title attribute with the <img> tag. The alt text will show if the picture cannot load, whereas title is for tooltip text.
 
1 members found this post helpful.
Old 01-06-2011, 07:11 AM   #4
rblampain
Senior Member
 
Registered: Aug 2004
Location: Western Australia
Distribution: Debian 11
Posts: 1,288

Original Poster
Rep: Reputation: 52
Thank you Guttorm, I had never heard of innerHTML and it is a real revelation since I can do other things with it. Using the <title> tag solves the problem very well and efficiently.

Thank you also paulsm4 but I already have the thumb pictures.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
basic html question - download link to files on my webpage question Davno Linux - Server 5 12-25-2009 07:24 AM
linux distro question & mysql install question natalie.aloi Linux - Newbie 5 07-19-2009 08:28 PM
onMouseOver/onMouseOut question rblampain Programming 2 02-28-2008 07:09 AM
Question, Apples Contribution to Open Source + MacOs file structure question Higgy3k Other *NIX 5 07-25-2005 04:23 AM
login prompt question & kde scheme question JustinCoyan Slackware 2 06-09-2004 02:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 12:02 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration