473,411 Members | 2,078 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Script help for mulitple browsers

Hi everyone
I know this has probably been asked a million times before but I have been searching the net for hours and have not found a solution so I am hoping one of you clever people will be able to help me. PLEASE!!

I am using this snow fall script http://www.dynamicdrive.com/dynamicindex3/rain.htm

It works perfectly in IE but not in Firefox or Safari.

Anyone have any idea how to help? I am not the best with the techno speak so not too complicated if at all possible!

Thank you so much to anyone who can help me out!
Dec 9 '09 #1
3 1174
Dormilich
8,658 Expert Mod 8TB
this script is not cross browser compatible (as far as I can tell from the first glance) you’d need to replace the used IE proprietary properties by something, that is able to read either ways.
Dec 9 '09 #2
Thanks for your reply, sorry to be so thick but do you know how I do this? I have no idea!!
Thanks
Dec 9 '09 #3
Dormilich
8,658 Expert Mod 8TB
basicly you have to do a conditional block, where you loop through all (mostly 2) known properties to get the value you want.

ex. (the properties may not be correct, just pulling from memory)
Expand|Select|Wrap|Line Numbers
  1. // always start with the ECMAScript or W3C standard
  2. if (window.clientWidth)
  3. {
  4.     var width = window.clientWidth;
  5. }
  6. // then test IE proprietary features
  7. else if (window.screenX)
  8. {
  9.     var width = window.screenX;
  10. }
  11. // throw error in case you’ve forgotten something
  12. else
  13. {
  14.     throw new Error("Could not determine browser width.");
  15. }
it may well be that there are such crossbrowser functions are already out there (e.g. there is a bunch of solutions for event handling)
Dec 9 '09 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

11
by: Wentink | last post by:
Does anybody have a simple script that let's me popup a picture from a thumbnail? The ones i found are all very very complicated and messy in the source... Thanks, Tintin
8
by: Johnny Knoxville | last post by:
I've added a favicon to my site (http://lazyape.filetap.com/) which works fine if you add the site to favourites the normal way, but I have some JavaScript code on a couple of pages with a link,...
11
by: Jonny | last post by:
Netscape 7.02 is giving me a headache with a downloaded snow script. Starting with a blank page, I inserted the script and checked it in IE 6 and Netscape 7.02. Everything worked and looked fine. A...
6
by: David | last post by:
Hey folks, I somehow managed to create a script that locks up Mozilla (1.3) tight. Here's the culprit, perhaps y'all can provide some insight into what the trouble is. (This script was cobbled...
4
by: Christopher Benson-Manica | last post by:
Obviously, compiliant browsers that encounter <script type="text/javascript"> <!-- // your script here // --> </script> will either execute the script or ignore it completely. However, we...
6
by: Brian | last post by:
Help.. We cannot get this script to work..can someone take a look at it and make suggestions? <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <title>Convert...
1
by: cwdjrxyz | last post by:
I am now writing many new pages in xhtml 1.1. They are served as true xhtml by setting the mime type of the server to application/xhtml+xml for the .xhtml extension. Since IE6 and some earlier...
5
by: Dave H | last post by:
I have an asp:listbox, allowing multiple selections, is there a quick check to see if there's more than one selected, or do I need to go through the whole list? Thanks, Dave
15
by: Lennart | last post by:
Hi folks, I have created an animated image gallery in dhtml. It works fine in Internet Explorer. In Firefox, it only works if I ommit the DOCTYPE tag. The page is valid xhtml-strict but with a...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
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,...
0
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...
0
Oralloy
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,...
0
jinu1996
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...
0
tracyyun
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...
0
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 using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.