PDA

View Full Version : Place VerticalScroller in specific cell (N4=picky)


Gordo
07-02-2002, 09:15 AM
N4.x again foils my plans ... temporarily?

Regarding this script (http://www.scriptasylum.com/scrollers/marquee/mq_vertical.html), can someone kindly code it such that I can have it appear in a specific table cell? N4.x has a problem with simply cutting-n-pasting it in the cell. IE6 has no problem! And I'm not even worrying about N6 nor Mozilla this time around. The page I intend to create just won't work in those browsers.

I'm hoping it's something simple like adding a function and calling it accordingly, but I am just not capable of doing this (yet). I guess the scroller code really needs to go in the <head></head>.

:confused:

Example table:

<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
<tr width="100%" height="17%">
<td width="100%" colspan="3"></td>
</tr>
<tr height="60%">
<td width="15%"></td>
<td width="68%"></td>
<td width="17%">SCROLLER TO GO HERE</td>
</tr>
<tr height="23%">
<td width="15%"></td>
<td width="68%"></td>
<td width="17%"></td>
</tr>
</table>

APPRECIATE IT!

glenngv
07-02-2002, 09:59 AM
try putting the if (ns4) part to what cell you want the scroller to:

<table border="0" cellpadding="0" cellspacing="0" height="100%" width="100%">
<tr width="100%" height="17%">
<td width="100%" colspan="3"></td>
</tr>
<tr height="60%">
<td width="15%"></td>
<td width="68%"></td>
<td width="17%">
SCROLLER TO GO HERE

<script language="javascript">

if (ns4){
txt+='<table cellpadding=0 cellspacing=0 border=0 height='+boxheight+' width='+boxwidth+'><tr><td>';
txt+='<ilayer name="ref" bgcolor="'+boxcolor+'" width='+boxwidth+' height='+boxheight+'></ilayer>';
txt+='</td></tr></table>'
txt+='<layer name="outer" bgcolor="'+boxcolor+'" visibility="hidden" width='+boxwidth+' height='+boxheight+'>';
txt+='<layer name="inner" width='+(boxwidth-4)+' height='+(boxheight-4)+' visibility="hidden" left="2" top="2" >'+content+'</layer>';
txt+='</layer>';
}else{
txt+='<div id="ref" style="position:relative; width:'+boxwidth+'; height:'+boxheight+'; background-color:'+boxcolor+';" ></div>';
txt+='<div id="outer" style="position:absolute; width:'+boxwidth+'; height:'+boxheight+'; visibility:hidden; background-color:'+boxcolor+'; overflow:hidden" >';
txt+='<div id="inner" style="position:absolute; visibility:visible; left:2px; top:2px; width:'+(boxwidth-4)+'; overflow:hidden; cursor:default;">'+content+'</div>';
txt+='</div>';
}
document.write(txt);

</script>

</td>
</tr>
<tr height="23%">
<td width="15%"></td>
<td width="68%"></td>
<td width="17%"></td>
</tr>
</table>

Gordo
07-02-2002, 10:20 PM
glenngv, I appreciate the reply, but that didn't do the trick.

I would think this would be easy for the JSperts here. :confused:

I await your replies....

adios
07-02-2002, 10:46 PM
Maybe it's just me; but

Copy and paste the following script in the HEAD section of your page

..won't get you much of anything.

<html>
<head>
</head>
<body><br><br>
<div align="center">
<table>
<tr>
<td height="10" bgcolor="coral"><br></td></tr>
<tr><td>
<script language="javascript">
/*******************************************
Vertical Scroller (Marquee Replacement) v-1.2
Brian Gosselin - http://scritpasylum.com
.......
.......[script here]
.......
setInterval('scrollbox()',speed);
}
</script>
</td></tr>
<tr><td height="10" bgcolor="coral"><br></td></tr>
</table>
</div>
</body>
</html>

Gordo
07-02-2002, 11:40 PM
adios -- Actually, pasting the entire code in the HEAD did work for me...but that's not my problem, nor how I'm trying to implement this script.

My JS code is in the table cell. I took the script code and pasted it in my table setup (see first post) and it works in IE and N4.x....BUT the "pause onmouseover" no longer works in any browser! Why?

When I also have code for autosizing my background image, etc. in the page, I then get a "scrollbox is not defined" javascript error in N4.x. IE displays the scroller, but (again) without the "pause onmouseover". :confused:

The code for my ENTIRE page (so far) is HERE (http://www.geocities.com/gordonmerrill/vertical_marque.htm).
GeoCities is only a testing ground...page will be on 'real' web host when finished.

This is sooooo frustrating. :mad:

adios
07-02-2002, 11:50 PM
Well....maybe Brian G. is having some fun here. Try copying & pasting the script directly from the source of the page linked to in your original post - not in the textarea. Notice where he embeds the script.

Would need to see that other script to determine the source of the conflict.

Gordo
07-03-2002, 12:06 AM
I never would have thought to check Brian G's source code. Wow. Okay, I copy-n-pasted HIS source code into my desired table cell. The "pause onmouseover" now works (again) in IE. But, I still get the "scrollbox is not defined" in N4.x.

It's got to be some sort of conflict with the other JavaScript (or something else?) on my page. I'm just don't know how to find and/or debug it.

PLEASE see my (latest) page's code in all its glory at:
http://www.geocities.com/gordonmerrill/vertical_marque2.htm

(thanks!!!!!)

adios
07-03-2002, 02:43 AM
Gordo...

That geocities page scared me. Interesting layout.

Anyway - it was that first script - the 'makeIm()' thing - that was breaking Navigator. Something to do with that gigantic LAYER it was generating. I'd lose it; scaling an image to window size rarely looks good. Threw together a sampler for you, hopefully it'll give you some ideas.

p.s. No line feeds in that scroller string!

scriptasylum
07-04-2002, 03:31 AM
Hello

Sorry, I wasn't trying to have any fun. It was an honest mistake. I simply forgot to copy the newer code from the page source to the select box.

Navigator may have a problem with the script if you are embedding the code into another layer. The script is assuming a certain object heirarchy (not nested) and we all know how NS4 likes to have the entire layer chain written out. You could replace my layer finding part of the script with one that "hunts" for the layer no matter where it may be nested. I usually use a nice one originally created by Mike Hall of Brainjar.com:

// FUNCTION TO FIND NESTED LAYERS IN NS4 BY MIKE HALL
function findlayer(name,doc){
var i,layer;
for(i=0;i<doc.layers.length;i++){
layer=doc.layers[i];
if(layer.name==name)return layer;
if(layer.document.layers.length>0)if((layer=findlayer(name,layer.document))!=null)return layer;
}
return null;
}

simple use it like:
var myLayer=(ns4)?findlayer('layername', document): (ie4)?document.all('layername'):document.getElementById('layername');

Hope this helps.

adios
07-05-2002, 07:36 PM
scriptasylum...

Only kidding, Brian ;) The layer in question (full screen) is not a parent layer to anything else - thought of that immediately - so it's not a referencing problem. As we've all noted by now, Navigator's handling of Layers is occasionally (inexplicably) odd, being affected by file placement, CSS, and other seemingly unrelated factors. In this case it seemed easier to just lose the other script, since it was of questionable value anyway.

cheers, adios

Gordo
07-06-2002, 04:32 AM
adios and scriptasylum...
thanks for the latest input.

(-s-w-o-o-s-h)...scriptasylum, that's the sound of your intellectual reply going way over my head. Unfortunately for me, I'm a major cut-n-paster, and can't really read such code, etc. Any edits such as this (layers, etc) will have to be by someone else (cough, cough)...not me. :o

The stretching of the background image is the primary reason I began this particular page setup. I'm working on something similar to Quiet Storm's page (http://www.angelfire.com/mo2/cbch21/index2.html). The bg image I'm using will require me to use the table setup that I provided in my initial post above. So, I'm just not able to remove any of the other scripting on my current page (http://www.geocities.com/gordonmerrill/vertical_marque2.htm). This is, of course, just a test page. The background image you now see on it is also only for testing. My real bg image will be large...1024px wide...so stretching won't be bad, etc. I also need the 100% height main table as I am disabling the scrollbar. The page is obviously geared towards IE users, but I'm really hoping for minimal problems in N4.x. I'm blowing off N6/Mozilla for this particular project. Macs are also not on my 'must work on' list (sorry Mac users).

I appreciate any further assistance any and all of you may be able to provide!!!

Gordo
07-08-2002, 07:51 AM
<bump>
Probably the last one for this topic. I may have to go with the horizontal version...of course, it's now having the same problem in N4.x. Anyway, I figured I'd give it one more shot before moving onward.
</bump>