473,748 Members | 4,067 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

title = status ? - part 2

Hello All,

Found a bit of Javascript on this forum that shows the title-text of a
link in the statusbar, so you don't have to type
onmouseover="wi ndow.status='bl a di bla'" in every link.

http://groups.google.nl/group/comp.l...22a5c1a40fd2a1

But it does not show the title when the link (<a href=""..>text</a>)
is in a DIV tag.
Can someone help me so all links on my page have a statusbar text on
mouse over no matter how deep they are nested.

Some example code:
<html>
<head>
<title>Test javascript title</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script>
function setMEvents() {
var oDocBodyNodes = document.body.c hildNodes;
for (var i = 0; i < oDocBodyNodes.l ength; i++) {
if (oDocBodyNodes[i].nodeType == 1 && typeof
oDocBodyNodes[i].title != 'undefined') {
oDocBodyNodes[i].onmouseover = function() { window.status
= this.title; return true; }
oDocBodyNodes[i].onmouseout = function() { window.status =
''; return true; }
}
}
}
</script>
</head>
<body onload="setMEve nts()">
<div id="test">this link is inside a DIV tag <a href="#" title="does
not work">and therefore does not work</a></div>
<a href="#" title="This works">This is a normal link which shows the
title in the statusbar on mouse over</a>
<div id="level0"<a href="#" title="link in div">link level 0 - link
in div</a><br>
<div id="level1"<a href="#" title="link in div in div">link level
1 - link in div in div</a></div>
</div>
</body>
</html>

Thanks,
Niels

PS: This only works in Internet Explorer since FireFox does not
support the statusbar text option.
PS 2: I do not want to go into a discussion about the use (or mis-use)
of the statusbar and it's intentional purpose. It all about optimizing
my code to get a smaller page size

Feb 28 '07 #1
2 1650
On Feb 28, 11:48 am, "NielsM" <brief4ni...@ho tmail.comwrote:
Hello All,

Found a bit of Javascript on this forum that shows the title-text of a
link in the statusbar, so you don't have to type
onmouseover="wi ndow.status='bl a di bla'" in every link.

http://groups.google.nl/group/comp.l...se_thread/thre...

But it does not show the title when the link (<a href=""..>text</a>)
is in a DIV tag.
Can someone help me so all links on my page have a statusbar text on
mouse over no matter how deep they are nested.

Some example code:
<html>
<head>
<title>Test javascript title</title>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1">
<script>
function setMEvents() {
var oDocBodyNodes = document.body.c hildNodes;
for (var i = 0; i < oDocBodyNodes.l ength; i++) {
if (oDocBodyNodes[i].nodeType == 1 && typeof
oDocBodyNodes[i].title != 'undefined') {
oDocBodyNodes[i].onmouseover = function() { window.status
= this.title; return true; }
oDocBodyNodes[i].onmouseout = function() { window.status =
''; return true; }
}
}}

</script>
</head>
<body onload="setMEve nts()">
<div id="test">this link is inside a DIV tag <a href="#" title="does
not work">and therefore does not work</a></div>
<a href="#" title="This works">This is a normal link which shows the
title in the statusbar on mouse over</a>
<div id="level0"<a href="#" title="link in div">link level 0 - link
in div</a><br>
<div id="level1"<a href="#" title="link in div in div">link level
1 - link in div in div</a></div>
</div>
</body>
</html>

Thanks,
Niels

PS: This only works in Internet Explorer since FireFox does not
support the statusbar text option.
PS 2: I do not want to go into a discussion about the use (or mis-use)
of the statusbar and it's intentional purpose. It all about optimizing
my code to get a smaller page size
This seemed pretty easy:

function setMEvents() {
for (var i = 0; i < document.getEle mentsByTagName( "a").length ; i++) {
var node = document.getEle mentsByTagName( "a")[i];
if (node.title) {
node.onmouseove r = function () { window.status = this.title; return
true; }
node.onmouseout = function () { window.status = ''; return true; }
}
}
}

Feb 28 '07 #2
Wow it works, THANKS a lot !!

This may seemed easy for you... I have no programming skills and
fooled around with the 'ChildNodes' to get it working with no results
of course ;-) Looks like the getElementsByTa gName does the trick.

Thanks again Tom.

Feb 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

50
5927
by: MozillaCensorsMe | last post by:
Hello, While I haven't finished my wonderful tutorial to save the world, I do have a simple question. What's the difference between h1 and the title tag? For me it seems as though both can be used interchangebly. For example, the articles on my site (andkon.com) have the same title as h1. Comments?
6
66138
by: Matt | last post by:
I want to disable the title bar, status bar and address bar of a window, but I couldn't find the syntax. I tried the following but not working. any ideas?? window.document.statusbar.enable = false; window.document.titlebar.enable = false; window.document.addressbar.enable = false; <html> <title>hey</title>
1
1396
by: Andrew | last post by:
Hi Sorry if this has been asked before but I can't seem to find an answer by googling. I'm creating a pop-up (it's a timer for hotel guest broadband access) with all attributes turned off. But becasue I have location set to 0 the damn url keeps appearing in the title bar. This causes a major problem as the pop-up displays a countdown in the titlebar that the user should be able to see even when minimised and at present cannot because...
1
1843
by: C-Sharper or C-Hasher, one of the two | last post by:
Hi Guys and Gals, I have a couple of problems related to centering forms on top of each other. I have a winforms app that has a status form that I want to popup in the center of my main form when some processing is taking place. In order to do this I need to find out the following information: 1. Where is my main form on the (current) screen in relation to the screen's 0,0 point? Once I have the location I can work out where the sub form...
0
3960
by: Matt | last post by:
I want to disable the title bar, status bar and address bar of a window, but I couldn't find the syntax. I tried the following but not working. any ideas?? window.document.statusbar.enable = false; window.document.titlebar.enable = false; window.document.addressbar.enable = false; <html> <title>hey</title>
4
1547
by: Benton | last post by:
Hi there, I have a child webform (with a ASP.NET calendar control) that opens in a javascript popup window when I click a button in the caller form. Child page has a <title> tag, and javascript window open options dictate "statusbar=no" While running the site inside VS 2003, the child page pops up as expected, with the specified title and no status bar. So far so good. However, once I take the binary and aspx files to the production...
4
10322
by: Jon | last post by:
Hi, I am calling the function showpopupWindow(item) to open and write a popup window. When testing in IE6 locally the popup window displays my text in both the title and status bars but when viewed online from my website the titlebar text is preceded by the full URL and a - ( eg http://www.........co.uk - text I want to display) and the status bar appears to only display Downloading picture...
2
8386
by: prash.marne | last post by:
hi guys, i have simple problem with my pop up window my code is .... <html> <head> <script type="text/javascript> function open_window(){ window.open("","","channelmode=0,directories=0,fullscreen=0,location=0,menubar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0,height=100,width=100"); }
1
1869
by: Carla Simeoni | last post by:
I would like to write seomthing into the title bar of the current Form "Form1". How can I do this ? How can I display/add a status bar (currently there is no such status bar) and write something into this status bar? Carla
0
8991
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8830
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9324
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9247
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8243
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6796
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3313
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2783
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2215
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.