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,wi dth,height,spee d,opacityTar)
{
// fakey speed convert to ensure int value
var speeda = speed*1
// fetch layer
var el = document.getEle mentById(id);
// get current size of layer
var h_size1 = el.offsetHeight ;
var v_size1 = el.offsetWidth;
// get size of screen
if (self.innerWidt h)
{
frameWidth = self.innerWidth ;
frameHeight = self.innerHeigh t;
}
else if (document.docum entElement &&
document.docume ntElement.clien tWidth)
{
frameWidth = document.docume ntElement.clien tWidth;
frameHeight = document.docume ntElement.clien tHeight;
}
else if (document.body)
{
frameWidth = document.body.c lientWidth;
frameHeight = document.body.c lientHeight;
}
var widthStepper = Math.round((wid th/100) *speeda);
var heightStepper = Math.round((hei ght/100) *speeda);
// the loop the loop
if (h_size1 < width || v_size1 < height)
{
//centers the layer
var topPos = ((frameHeight/2) - (h_size1/2)) + window.pageYOff set;
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.a ppName.match("M icrosoft"))
{
if(el.style.opa city < (opacityTar/100))
{
var opacity = ((el.style.opac ity*10) + 1)/10
el.style.opacit y=opacity
}
}else{
el.style.filter ="alpha(opacity ="+opacityTar+" )";
}
// defines a timeout to get that sweet animated effect
r = setTimeout("vis aLager('" + id + "','" + width + "','" + height +
"', '" + speed +"','" + opacityTar + "')", 1);
}else{
// clear the timeout when target size is set
clearTimeout(r)
}
}
[/code] 10 1426 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.javas cript: 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.c om, 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 crossbrowserpro gramming
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,wi dth,height,spee d,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.getEle mentById(id);
if (document.getEl ementById && document.getEle mentById(id)){
var el = document.getEle mentById(id);
}var topPos = ((frameHeight/2) - (h_size1/2)) + window.pageYOff set;
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.javas cript 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. 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 here.....
--------
//
// a set of simple C# wrappers over the NT Defragmenter APIs
//
|
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 is used by the user
2- check if a link to my application is there
3- if so, obtain the path (ANY PATH) to the quick-launch-folder from
existing button(s)
|
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 imported into SSS.
Now we build applications using SSS as a reference, and we found some
problems exist in CCC.
From our applicatyion, We can Debug into SSS, but cannot go further into CCC.
|
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 v1.1 (which I did)
In the book they gave me the following code:
<script language="vb" runat="server">
|
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 there anywhere to enable the debug
mode into library class.
thanks
rena.
| |
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 the debugger from VS, I am told it can't because
the project is of output type class library. The error indicates I
should set the start action to start external program or start URL.
I tried both of these and cannot seem to get the debugger to...
|
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 the usage of script in web application development.
Can i set the debug enviroment for Javascript code. All the script are
written in aspx page.
|
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 http://blogs.crankygoblin.com/blogs/geoff.appleby/pages/50712.aspx. I've also read the post on this topic by bggraphics, but he doesn't arrive at a final result. The main problem I am having is that the layerX and layerY event properties don't work. They're supposed to return the...
|
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 installed same application on another
server Win 2003 R2 Std (No Active Directory). On that server I get
“Permission denied” using the following code (used to zip folder
content).
|
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 the Debug= True in the
Web.config which I do. Then try to run it again and it says I must enable
integrated security which I do. I then try to run it again and get the HTTP
403 error - " This error (HTTP 403 Forbidden) means that Internet...
|
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
| |
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed.
This is as boiled down as I can make it.
Here is my compilation command:
g++-12 -std=c++20 -Wnarrowing bit_field.cpp
Here is the code in...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own....
Now, this would greatly impact the work of software developers. The idea...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |