Since I'm a mac-head, I don't have the possibility to make this little
script I wrote work proper on a MSIE browser.
I know there's smarts in here that easily could spot my f**k ups and
tell me what I'm doing wrong.
Code works just fine on Firefox 1.5, Safari 2.0 and Opera (with some
minor buggs)
On explorer, as far as I know, it just produce page errors with cryptic
error messages.
Can anybody help me?
The script
[THE CODE]
function visaLager(id,width,height,speed,opacityTar)
{
// fakey speed convert to ensure int value
var speeda = speed*1
// fetch layer
var el = document.getElementById(id);
// get current size of layer
var h_size1 = el.offsetHeight;
var v_size1 = el.offsetWidth;
// get size of screen
if (self.innerWidth)
{
frameWidth = self.innerWidth;
frameHeight = self.innerHeight;
}
else if (document.documentElement &&
document.documentElement.clientWidth)
{
frameWidth = document.documentElement.clientWidth;
frameHeight = document.documentElement.clientHeight;
}
else if (document.body)
{
frameWidth = document.body.clientWidth;
frameHeight = document.body.clientHeight;
}
var widthStepper = Math.round((width/100) *speeda);
var heightStepper = Math.round((height/100) *speeda);
// the loop the loop
if (h_size1 < width || v_size1 < height)
{
//centers the layer
var topPos = ((frameHeight/2) - (h_size1/2)) + window.pageYOffset;
var leftPos = ((frameWidth/2) - (v_size1/2));
// ensures us that the layer doesnt cover the cats
if(topPos< 200) { topPos = 210; }
// and here we place the layer
el.style.top = topPos + "px";
el.style.left = leftPos + "px";
if(h_size1 < height)
{
// updates the height of the layer
el.style.height = (h_size1 + heightStepper) +"px";
}
if(v_size1 < width)
{
// updates the width of the layer
el.style.width = (v_size1 + widthStepper) +"px";
}
//dont animate opacity in Explorer, just set it
if(!navigator.appName.match("Microsoft"))
{
if(el.style.opacity < (opacityTar/100))
{
var opacity = ((el.style.opacity*10) + 1)/10
el.style.opacity=opacity
}
}else{
el.style.filter="alpha(opacity="+opacityTar+")";
}
// defines a timeout to get that sweet animated effect
r = setTimeout("visaLager('" + id + "','" + width + "','" + height +
"', '" + speed +"','" + opacityTar + "')", 1);
}else{
// clear the timeout when target size is set
clearTimeout(r)
}
}
[/code] 10 1416 li*************@gmail.com wrote: Since I'm a mac-head, I don't have the possibility to make this little script I wrote work proper on a MSIE browser. I know there's smarts in here that easily could spot my f**k ups and tell me what I'm doing wrong.
Code works just fine on Firefox 1.5, Safari 2.0 and Opera (with some minor buggs)
On explorer, as far as I know, it just produce page errors with cryptic error messages.
Can anybody help me?
Hi Daniel,
Allow me to give you a little unasked advise. ;-)
If you want to publish anything on the web, you have little choice.
You just NEED to get a W$-machine with IE to test your code.
How can you publish your pages without testing it on IE4/5/6 ??
You'll have to test your whole site, not just this piece of JS.
IE, firefox, opera, Safari, etc in all their versions... It is just too much
too 'guess and keep fingers crossed'.
So take your wallet, go buy some W$ OS, and use it as a testmachine.
Or go to somebody in your neighbourhood who has IE running. (In my
neighbourhood more people than I would like are using IE, so I expect it
won't be hard to find one.)
You cannot expect the visitors of this group to do that testing for you. :-/
Futhermore, if you are interested in good books on Javascript or CCS, I
advise:
- Dynamic HTML, the definite Guide (SE) by O'Reilly
- Javascript, the definite Guide (4th edition) also by O'Reilly
Regards,
Erwin Moller The script
<snipped>
I rarely code for the web, hence no need to buy a win machine to
betatest, but we got some at the office since I'm the only one on the
mac, but I can't run around on their machines all day, they got to work
to ;)
I would never publish sites for customers without seriously testing
them on every system.
So thanks for the unasked advise, but I'm aware.
I was just hoping that someone could take a quick look and see if they
spotted any easy misstakes, not do my betatesting.
But I will turn elsewhere in the future. : /
wrote on 09 mei 2006 in comp.lang.javascript : I rarely code for the web, hence no need to buy a win machine to betatest, but we got some at the office since I'm the only one on the mac, but I can't run around on their machines all day, they got to work to ;)
I would never publish sites for customers without seriously testing them on every system. So thanks for the unasked advise, but I'm aware.
I was just hoping that someone could take a quick look and see if they spotted any easy misstakes, not do my betatesting. But I will turn elsewhere in the future. : /
You seem to be touchy about something, but since you are not quoting,
how can we tell about what and whom?
Please always quote on usenet.
If you want to post a followup via groups.google.com, don't use the
"Reply" link at the bottom of the article. Click on "show options" at the
top of the article, then click on the "Reply" at the bottom of the
article headers. <URL: http://www.safalra.com/special/googlegroupsreply/
--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress) li*************@gmail.com wrote: I rarely code for the web, hence no need to buy a win machine to betatest, but we got some at the office since I'm the only one on the mac, but I can't run around on their machines all day, they got to work to ;)
Ok clear.
But still, you want your code to work for IE.
If not, why would you be asking here?
So you do need a M$-machine to test.
As I said in my previous response: There is more to crossbrowserprogramming
than just this piece of JS. I would never publish sites for customers without seriously testing them on every system. So thanks for the unasked advise, but I'm aware.
Good. :-) I was just hoping that someone could take a quick look and see if they spotted any easy misstakes, not do my betatesting.
If you are lucky, somebody does spot your mistake.
I was not telling you to go away here, that is your oversensitive
interpretation.
I was just trying to warn you about... well you know.
But I will turn elsewhere in the future. : /
Oh, come on. Don't be like that.
Regards,
Erwin Moller
>Oh, come on. Don't be like that. <
Hehe well, I was stressed. And tired of cross-browser issues in js. Why
can't explorer just go away? :D li*************@gmail.com said the following on 5/9/2006 3:59 AM: Since I'm a mac-head, I don't have the possibility to make this little script I wrote work proper on a MSIE browser. I know there's smarts in here that easily could spot my f**k ups and tell me what I'm doing wrong.
Post a URL to the full page, HTML and all.
Code works just fine on Firefox 1.5, Safari 2.0 and Opera (with some minor buggs)
On explorer, as far as I know, it just produce page errors with cryptic error messages.
IE does have some cryptic messages until you get used to them.
Can anybody help me?
The script
[THE CODE] function visaLager(id,width,height,speed,opacityTar) { // fakey speed convert to ensure int value var speeda = speed*1
var speeda = +speed;
//unary + is faster and simpler than multiply by 1.
//But, that line is unneeded as you multiply with it
//and multiplication does explicit type conversion.
// fetch layer var el = document.getElementById(id);
if (document.getElementById && document.getElementById(id)){
var el = document.getElementById(id);
}var topPos = ((frameHeight/2) - (h_size1/2)) + window.pageYOffset;
The above line is your first error. IE doesn't support pageYOffset, it
uses scrollTop and it gets even stranger as it depends on the doctype in
use how you go about getting it.
<snip>
I didn't hunt more errors after that one.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
thanks Randy, I will look deeper into those lines.
On a sidenote, does anyone know if there's a debugger extension of some
sort to MSIE? For looking at DOM Trees and such.
Firefox has some useful extensions and Safari has a what they call
"Debug menu". li*************@gmail.com wrote: Oh, come on. Don't be like that. <
Hehe well, I was stressed. And tired of cross-browser issues in js. Why can't explorer just go away? :D
Hi,
Crossbrowser issues are really annoying.
Everybody thinks the same.
The two books I recommended to you in my other posting are a GREAT help
coding things the right from the start.
They are both aimed to be comprehensive and the authors really did a great
job to present all cross-browser-issues in way everybody can easily
understand.
Both books also try to find the common ground for all browsers.
Once you master that part, crossbrowser scripting becomes a lot easier.
I always start looking for solutions that are presented in the chapters of
the books that descripe the 'common api'.
If you have time, read them.
I know, when you have presure to finish some project, you don't have time to
study a book, but in the end they pay back the time manyfold you invest in
them. :-)
/me loves O'Reilly series.
Good luck.
Regards,
Erwin Moller
Yeah I should get some books, then again, the net have so much already,
to bad you have to go looking for it :p
when all the information I need comes to me without me needing to do
anything I will declare the web "2.0", until thenI say it's still just
1 (ok 1.5 then).
This is actually the first time I try to write something a little more
complex (than form and window flirks) from scratch out of what I picked
up from around. My only real experience from js otherwise is singel
plattform development for our intranet and the AS approach to it in
flash.
JRS: In article <bv******************************@comcast.com>, dated
Tue, 9 May 2006 07:20:55 remote, seen in news:comp.lang.javascript,
Randy Webb <Hi************@aol.com> posted : var speeda = +speed;
//unary + is faster and simpler than multiply by 1. //But, that line is unneeded as you multiply with it //and multiplication does explicit type conversion.
Since speeda is used repeatedly (ISTM) after that, it may be better to
do a single explicit conversion there rather than repeated ones later
on; but it will not make much difference.
--
© John Stockton, Surrey, UK. ?@merlyn.demon.co.uk Turnpike v4.00 IE 4 ©
<URL:http://www.jibbering.com/faq/> JL/RC: FAQ of news:comp.lang.javascript
<URL:http://www.merlyn.demon.co.uk/js-index.htm> jscr maths, dates, sources.
<URL:http://www.merlyn.demon.co.uk/> TP/BP/Delphi/jscr/&c, FAQ items, links. This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Jim Hubbard |
last post by:
I have some C# code that is supposed to wrap the defrag APIs and I am trying
to convert it to VB.Net (2003). But, I keep having problems.
The C# code is relatively short, so I'll post it...
|
by: Dutchy |
last post by:
Dear reader,
In an attempt to obtain the path to the quick-launch-folder in order to
create a shortcut to my application-updates during installation , I thought
to:
1- check if quick launch...
|
by: VicVic |
last post by:
Dear Great Experts,
I have a problem and need your help!
We have a Flat DLL built in C++ (CCC), and on top of it, we built another
DLL built in C# (SSS), which has .Net Assembly. CCC was...
|
by: Marek Krzeminski |
last post by:
I am new to ASP and I am having some problems that I hope someone can help
me with.
I am using WindowsXP and a book to try to learn ASP.
The book instructed me to install IIS & .Net Framework...
|
by: Rena |
last post by:
Hi all,
I have created a app. project and a library which will be used by the
main project, however i do not know how to get into debug mode inside the
library, although break point is set. is...
| |
by: keyser_Soze |
last post by:
I have MS Visual Studio 2003 on Windows XP Pro. I have IIS running on
this machine and I am trying to debug some existing code which has both
ASP and ASP.NET components.
When I try and launch...
|
by: TARUN |
last post by:
Hello all
I am new to web technology, so plz excuse me for posting such a silly
question .
I have a code in C#.NET , ASP.NET, Javascript . I am a begginer of
Javascript i don't
understand...
|
by: dli07 |
last post by:
Hello,
I'm trying to convert a piece of code that creates a dynamic vertical resizing bar in a table from internet explorer to firefox. It's based on a post from...
|
by: private.anders |
last post by:
Hi David!
Really need assistance since I have been struggling with a problem
long time now.
I am running a web application on a Win 2003 Std (Active Directory).
Everything works fine. I have...
|
by: Harry Simpson |
last post by:
I've been away from ASPNET - I open up a new Web app in VS2008 and go into
properties and select to use IIS instead of the personal web server. Then
I run in debug mode and it says I have to set...
|
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,...
| |
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
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...
|
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...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
|
by: TSSRALBI |
last post by:
Hello
I'm a network technician in training and I need your help.
I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs.
The...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
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...
| |