|
|
|||||||||
|
|||||||||
| |||||||||
|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
Stay one step ahead of the competition. Evaluate and give feedback
on some of the hottest web development tools on the market today.
Make your opinion heard! Click
Here
|
|
#1
|
||||
|
||||
|
Only works in IE
as the whole thing flashes in NS6 ...Here we go with more javascript... this time it's an LED style clock with a button that switches between 12/24 hour format. Looks pretty, and that's what counts. Check out the javascript forum on devshed for more code from me. [SIZE=SMALL]The small print: All these fancy little code snippets posted on Devshed by Binky are 100% Binky and have not been taken from other sites. They may be based upon code examples from various sites, but the code from those examples has in no way whatsoever been used as the basis for the examples posted by Binky. [/SIZE] |
|
#2
|
||||
|
||||
|
Actually, it works well in mozilla also. Isn't that weird...
I have a question for you binky, are you any good at javascript in ns4? |
|
#3
|
||||
|
||||
|
Now that all depends, if it means:
Can I do NS4 compatable javascript when I want to, then yes. But, if it means: Do I make a habit of the above, then no. It depends how much NS4 dependencies are involved. I'll have a go at anything to be honest though. |
|
#4
|
||||
|
||||
|
Ok, mabey you can help then. I have a habit of trying to make thinks work/look the same across the different browsers. On my most current class I have run into a problem with this. It is a progress bar and it works great in ie, ns6, mozilla and konquerer, but doesn't in opera and ns4. What it does is it uses a table to simulate the bar by increasing the width. This works fine for the other browsers, but not for ns4 and opera. Currently for them I have been just making the table flash on and off, which looks crappy compared to the other style. Any ideas?
|
|
#5
|
||||
|
||||
|
Eh? For some reason the browser wants to download the file as 'attachment.php' and winzip wont open the file.
Anyway, it's end of the working day for me in 5 minutes. So it'll be monday at the earliest. The last progress bar I created used <divs> to represent the bar. It dynamically showed the weight load on the servers CPUs. Something different needed here, but I'll have a go at it. |
|
#6
|
||||
|
||||
|
It opened up for download fine for me. Appreciate you taking a look at it. This class uses a mixture of div and tables. Currently, for testing purposes it just loops expanding until it hits the end of the bar and then restarts, but this will have the capability of being fed info to expand the bar as needed.
|
|
#7
|
||||
|
||||
|
This may help:
Code:
<html>
<head>
<style type="text/css">
</style>
<script type="text/javascript">
var isIE = ((navigator.userAgent.indexOf("MSIE") != -1) && (navigator.userAgent.indexOf("Opera") == -1));
var isNS4 = ((navigator.appName == "Netscape") && (navigator.userAgent.indexOf("Gecko") == -1))
var isOpera = (navigator.userAgent.indexOf("Opera") != -1)
var isNS6 = ((navigator.appName == "Netscape") && (navigator.userAgent.indexOf("Gecko") != -1))
function plus(value) {
if (isIE || isNS6 || isOpera) {
newValue = parseInt(document.getElementById('bar').style.width) + value/100*300
if (newValue <= 300) {
document.getElementById('bar').style.width = newValue
} else {
document.getElementById('bar').style.width = 300
}
} else {
newValue = parseInt(document.bar.clip.width) + value/100*300
if (newValue <= 300) {
document.bar.clip.width = newValue
} else {
document.bar.clip.width = 300
}
}
}
function minus(value) {
if (isIE || isNS6 || isOpera) {
newValue = parseInt(document.getElementById('bar').style.width) - value/100*300
if (newValue < 0) {
document.getElementById('bar').style.width = 0
} else {
document.getElementById('bar').style.width = newValue
}
} else {
newValue = parseInt(document.bar.clip.width) - value/100*300
if (newValue < 0) {
document.bar.clip.width = 0
} else {
document.bar.clip.width = newValue
}
}
}
</script>
</head>
<body>
<script type='text/javascript'>
if (isIE || isNS6 || isOpera) {
document.write("<div style='position:absolute; top:100; left:100; background-color:black; height:20; width:300;'></div><div id='bar' style='position:absolute; top:100; left:100; width:0; height:20; background-color:blue;'></div>")
} else if (isNS4) {
document.write("<layer top=100 left=100 width=300 height=20 bgcolor='black'></layer><layer name='bar' top=100 left=100 width=0 height=20 bgcolor='blue'></layer>")
}
</script>
<form>
<input type='button' value='+10%' onClick='plus(10)'>
<input type='button' value='+1%' onClick='plus(1)'>
<input type='button' value='-1%' onClick='minus(1)'>
<input type='button' value='-10%' onClick='minus(10)'>
</form>
</body>
</html>
Last edited by binky : May 20th, 2002 at 05:31 AM. |
|
#8
|
||||
|
||||
|
You are the man binky, thanks for the help.
|
|
#9
|
||||
|
||||
|
You're welcome..
![]() |
![]() |
| Viewing: Dev Shed Forums > Other > Dev Shed Lounge > No more boring clocks! |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|