PDA

View Full Version : Finding a button.class script for NS6+


^KoalaBear^
09-17-2002, 07:08 AM
I have been trying to find a navbar the same or very similar to the one on this site which uses button.class applet to work. It works fine for IE6 and NS4+ but not NS6+

http://www.geocities.com/ResearchTriangle/Node/1533/buttonclass.html

You'll see the exception error I get when I try to view it with NS6+ here at this mockup site:

http://home.graffiti.net/kbs_great_aussie_sites/ns6/button-class.html

Is there anyway of changing the code to make it acceptable to NS6+ ...........OR........... does anyone know of a similar type buttoned navbar as seen on the above sites, please?

Cheers!

KB...

umm
09-18-2002, 09:07 AM
Does NS6 understand <applet>? It is deprecated. I'm not certain either way. Maybe it's the <object> element you are after.

http://www.w3.org/TR/html4/struct/objects.html

Alekz
09-18-2002, 09:31 AM
Hi,
Go to http://www.fresh.bg and look if the buttons are good to You. There's pure JavaScript - no applets...

Alex

^KoalaBear^
09-20-2002, 04:57 AM
Originally posted by umm
Does NS6 understand <applet>? It is deprecated. I'm not certain either way. Maybe it's the <object> element you are after.
http://www.w3.org/TR/html4/struct/objects.html

G'day Mate!
That's an interesting site, full of good gutsy info. I just wish I was still young and techi enough to understand it! LOL
My experience at the moment is pretty much copy and paste scripts with just some amendments. I do not know 'pure' html yet, unfortunately. I really do appreciate your reply though.
Cheers

KB...

^KoalaBear^
09-20-2002, 05:01 AM
Originally posted by Alekz
Hi,
Go to http://www.fresh.bg and look if the buttons are good to You. There's pure JavaScript - no applets...
Alex

G'day Alex...
Thanks for that lead. I'm currently trying to 'read and understand' the source code on the top buttons of that Russian (?) site, although it is not exactly like the button.class ones I am having trouble with.
Thanks for your reply. I appreciate any help I can get.
Cheers

KB...

umm
09-20-2002, 05:17 AM
You get the same effect with a rollover script. Just make your own images. If you want to do that I can give you a pretty straight forward rollover script.

^KoalaBear^
09-20-2002, 07:11 AM
Originally posted by umm
You get the same effect with a rollover script. Just make your own images. If you want to do that I can give you a pretty straight forward rollover script.

Hi again Umm...

Thanks for that kind offer. I have constructed sets of two buttons per link... up1.jpg and dn1.jpg (dn being the hover button), up2.jpg and dn2.jpg etc. each being 76x18pxls in size. I would like to create a bank of 8 across and aligned on the right margin, if that's possible. Is there anyway of hiding the ant track/colours around the button when they are pressed?
Thanks for your help!!
:thumbsup:

KB...

^KoalaBear^
09-20-2002, 07:54 AM
Here you are Umm...

Here (http://home.graffiti.net/kbs_great_aussie_sites/navbar/buttons.html) is the test page I uploaded so far to try and save some work in your offer of coding.

And here is the code, so far...

</head>
<body background="bg-wattle-textured.gif">

<center><img SRC="logo-bg-finetex-575x312.gif" height=312 width=575></center>

<div align=right>
<p><a href="http://www.link1"><img SRC="up1.jpg" height=18 width=76></a><a href="http://www.link2"><img SRC="up2.jpg" height=18 width=76></a><a href="http://www.link3"><img SRC="up3.jpg" height=18 width=76></a><a href="http://www.link4"><img SRC="up4.jpg" height=18 width=76></a><a href="http://www.link5"><img SRC="up5.jpg" height=18 width=76></a><a href="http://www.link6"><img SRC="up6.jpg" height=18 width=76></a><a href="http://www.link7"><img SRC="up7.jpg" height=18 width=76></a><a href="http://www.link8"><img SRC="up8.jpg" height=18 width=76></a></div>

<p><br>
</body>
</html>

Alekz
09-20-2002, 07:55 AM
Hi, ^KoalaBear^

http://www.fresh.bg is a bulgarian site, not russian, but still cyrillic :)

Look for dhtmlButton function - it's the dhtmlButton class constructor. Buttons can virtually have 5 different states -> flat, raised, sunken, disabled-flat and disabled-sunken (for toggle buttons which are disabled in pressed state). You just have to set one or both of the button properties -> (btn.flat and/or btn.toggle) then the appropriate button behavior is done authomatically. For all of these states (ot just for the states You need) You'll have to assign different images, so the look and behavior of a button is very customizable.
Oh, about button bars - You can pass a reference to a DIV in the constructor, then all button coordinates (left,top) are relative to the parent layer and when You move the parent layer it is moved with all of the child buttons.
Well that's a brief description - if You have further questions, ask :)

Alex

P.S.
Here's a sample how to initialize it:

//Instanciate
theBtn = new dhtmlButton();
//Size and position
theBtn.top = 100;
theBtn.left = 100;
theBtn.width = 20;
theBtn.height = 20;
//Images
theBtn.imgBtnIdle = 'img/imgBtnIdle.gif';
theBtn.imgBtnPressed = 'img/imgBtnPressed.gif';
theBtn.imgBtnDisabled = 'img/imgBtnDisabled.gif';
theBtn.imgBtnReady = 'img/imgBtnReady.gif';
theBtn.imgBtnPressedDisabled = 'img/imgBtnPressedDisabled.gif';
//Events
theBtn.onMouseOver = btnMouseOver;
theBtn.onMouseOut = btnMouseOut;
theBtn.onMouseDown = btnMouseDown;
theBtn.onMouseUp = btnMouseUp;
theBtn.onClick = btnMouseClick;
//Show it
theBtn.init();

^KoalaBear^
09-20-2002, 08:13 AM
Originally posted by Alekz
http://www.fresh.bg is a bulgarian site, not russian, but still cyrillic
[/CODE]

LOL I knew as soon as I typed Russian it would be one of the other 'cryllic' nations. The .bg should have told me if I was alert enough!! :o

I am going to try and persevere with your advice although please understand I am a 60 yr old nerd :confused: and not yr everyday funky 20 yr old techi! :cool: sooooo it will take me some time.. LOL

My shrink (Psych) suggested I take up creative web design for relaxation from my major depressive condition!! Methinks he's a saddist LMAO... :D

KB...

Alekz
09-20-2002, 08:25 AM
20 yr old :) Thank's a lot, I'll show this thread to my wife :)))
Actually 31... :)

Alex

^KoalaBear^
09-20-2002, 08:33 AM
Originally posted by Alekz
20 yr old :) Thank's a lot, I'll show this thread to my wife :)))
Actually 31... :)

Alex

ROFL.... Well 31 is still alot closer to 20 than 60 is mate!! :D

I had another look at both the source code and some of the associated .js files... and I honestly think that level of learning and understanding is for my next life! LOL

Nowwwww.... if you wanted to show me what you mean by using my own test code (see site and code above) that I posted to Umm... I'd be more than grateful! LOL ;)

Perhaps if I start with something simple to understand I can work up from there...... yes??

Cheers

KB...

umm
09-20-2002, 08:47 AM
:) :) :D :D :) :)

Best laugh I've had for a while!!!

^KoalaBear^
09-20-2002, 09:33 AM
Originally posted by umm
:) :) :D :D :) :)

Best laugh I've had for a while!!!

Were you laughing at my posts to you... or my post to Alex? :o LOL

Thanks for pointing out where the DELETE button was in Edit Control, Umm... I was looking everywhere but up the top?

KB...

umm
09-20-2002, 09:59 AM
LOL, the dialogue between you and alex :)

Alekz
09-20-2002, 10:01 AM
Hi,
Here's a sample for dhtmlButton widget
http://www24.brinkster.com/alekz/default_js.htm
There's almost all You can do with that button...

Alex

^KoalaBear^
09-20-2002, 10:09 AM
LOL.... Well Umm.. there was a time when I was a smart cookie too! Even if it was a coupla centuries ago!! Dayummn!

Thanks for the tut you sent me. Am trying to apply it as we speak :( ......Don't let go the lifeline just yet! LOL

Which state of the 'Antipodes' are ya in?

KB...

umm
09-20-2002, 10:15 AM
well, you've got a couple of things there to go on with KB. Alekz has got a really nice script there :)

The tut I sent is just one of many tuts around the place. It's a starting point anyway.

QLD, Sunshine Coast :thumbsup:

^KoalaBear^
09-20-2002, 10:22 AM
Originally posted by Alekz
Hi,
Here's a sample for dhtmlButton widget
http://www24.brinkster.com/alekz/default_js.htm
There's almost all You can do with that button...


Please don't think I don't appreciate your interest, posts and advice Mate, as I am honestly trying to comprehend the information you're directing me to. It is wayyyyyy above my head as I read it on first glance. Perhaps if I pour a scotch and take two asprin it will become clearer in the morning! LOL

KB...
:thumbsup:

^KoalaBear^
09-20-2002, 10:44 AM
You're right... Alex does have a very nice script there! ROFL. Wish I had one just like it!!!

Thanks for your help too, Mate. I'll keep struggling on till they come to carry me away. LOL

I have family up at Noosa but find it harder and harder to get up there these days. I suppose you think you're gonna get rich on backin the Lions to beat the Power on Sat night? Careful how much you outlay, bro! ;) ........maybe you prefer that 'other' game, huh? lol

Thanks Cobber

KB...

umm
09-23-2002, 10:43 PM
Originally posted by ^KoalaBear^

I have constructed sets of two buttons per link... up1.jpg and dn1.jpg (dn being the hover button), up2.jpg and dn2.jpg etc. each being 76x18pxls in size. I would like to create a bank of 8 across and aligned on the right margin, if that's possible.
KB...


<!doctype html public "-//w3c//dtd html 4.0 transitional//en">
<html>
<head>
<title>buttons-sample</title>
<script language="javascript1.1" type="text/javascript">
<!--
var imgUp = new Array();
var imgDn = new Array();
var pth= "";

for (i=0;i<8;i++){
imgUp[i] = new Image();
imgUp[i].src = pth + "up"+(i+1)+".gif";
imgDn[i] = new Image();
imgDn[i].src = pth + "dn"+(i+1)+".gif";
}
function rollOver(i){
document.up[i].src = imgDn[i].src;
}

function rollOut(i){
document.up[i].src = imgUp[i].src;
}
// -->
</script>
</head>
<body>
<img
<p>
<a href="http://www.link1"><img SRC="up1.gif" height="18" width="76" onMouseOver="rollOver(0)" onMouseOut="rollOut(0)"border="0" name="up"></a>
<a href="http://www.link2"><img SRC="up2.gif" height="18" width="76" onMouseOver="rollOver(1)" onMouseOut="rollOut(1)"border="0" name="up"></a>
<a href="http://www.link3"><img SRC="up3.gif" height="18" width="76" onMouseOver="rollOver(2)" onMouseOut="rollOut(2)"border="0" name="up"></a>
<a href="http://www.link4"><img SRC="up4.gif" height="18" width="76" onMouseOver="rollOver(3)" onMouseOut="rollOut(3)"border="0" name="up"></a>
<a href="http://www.link5"><img SRC="up5.gif" height="18" width="76" onMouseOver="rollOver(4)" onMouseOut="rollOut(4)"border="0" name="up"></a>
<a href="http://www.link6"><img SRC="up6.gif" height="18" width="76" onMouseOver="rollOver(5)" onMouseOut="rollOut(5)"border="0" name="up"></a>
<a href="http://www.link7"><img SRC="up7.gif" height="18" width="76" onMouseOver="rollOver(6)" onMouseOut="rollOut(6)"border="0" name="up"></a>
<a href="http://www.link8"><img SRC="up8.gif" height="18" width="76" onMouseOver="rollOver(7)" onMouseOut="rollOut(7)"border="0" name="up"></a>
<p>
</body>
</html>

^KoalaBear^
09-24-2002, 08:29 AM
You dun good, mate! That script worked just fine after I realised I had jpegs and not gifs! LOL

One day when I get enough courage, I'm gonna ask you about the first part of your code, though! :o

Thanks Mate! Muchly appreciated!

Cheers
KB...