Print Page | Close Window

Javascript

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=3009
Printed Date: 29 March 2026 at 4:24pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript
Posted By: Mart
Subject: Javascript
Date Posted: 25 May 2003 at 8:22am

Is anyone here good at modifing javascript? Because I'm useless can you get this script:

<script language="JavaScript1.2">

//Highlight Table Cells Script-- By Dynamic Drive
//For full source code and more DHTML scripts, visit http://www.dynamicdrive.com - http://www.dynamicdrive.com
//This credit MUST stay intact for use

var ns6=document.getElementById&&!document.all
var ie=document.all

function changeto(e,highlightcolor){
source=ie? event.srcElement : e.target
if (source.tagName=="TR"||source.tagName=="TABLE")
return
while(source.tagName!="TD"&&source.tagName!="HTML")
source=ns6? source.parentNode : source.parentElement
if (source.style.backgroundColor!=highlightcolor&&source.id!="ignore")
source.style.backgroundColor=highlightcolor
}

function contains_ns6(master, slave) { //check if slave is contained by master
while (slave.parentNode)
if ((slave = slave.parentNode) == master)
return true;
return false;
}

function changeback(e,originalcolor){
if
(ie&&(event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="ignore")||source.tagName=="TR"||source.tagName=="TABLE")
return
else if (ns6&&(contains_ns6(source, e.relatedTarget)||source.id=="ignore"))
return
if (ie&&event.toElement!=source||ns6&&e.relatedTarget!=source)
source.style.backgroundColor=originalcolor
}

</script>

To highlight the whole row because it is split up into two columns?




Replies:
Posted By: KCWebMonkey
Date Posted: 27 May 2003 at 6:52am

I'll bet that this script only works in IE6 & NS6...

what is your problem with it?



Posted By: Mart
Date Posted: 27 May 2003 at 11:33am

If you have a table with two columns it only highlights the row in each column not both columns (its quite hard to explain http://www.minac.co.uk/db - http://www.minac.co.uk/db  if you don't get what I mean go on that)

Can it be modified?

Thanks, Martin.



Posted By: KCWebMonkey
Date Posted: 27 May 2003 at 2:12pm
Why don't you just make it one cell (column) instead of 2?


Posted By: Mart
Date Posted: 27 May 2003 at 2:14pm
Because I still want the seperator thing down the middle...



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net