Please I need some help, I have this function that I need to test it in Firefox 2.0.
I am a JavaScript beginner, so I don't know how to test this. I just need someone to show me how I can create a function in HTML to check if this function stretchHV(......) works good in Firefox.
//Gradually resize a DIV (both vertically and horizontally)
function stretchHV(divName,initVSize,finalVSize,initHSize,f inalHSize,steps)
{
var curEl=document.getElementById( divName );
if (steps>0)
{
var diffV=(finalVSize-initVSize)/steps;
var diffH=(finalHSize-initHSize)/steps;
curEl.style.height='' + eval(initVSize + diffV) + 'px';
curEl.style.width='' + eval(initHSize + diffH) + 'px';
setTimeout("stretchHV('" +divName +"'," +eval(initVSize+diffV)+ "," +finalVSize+ "," +eval(initHSize+diffH)+ "," +finalHSize+ "," +eval(steps-1)+ ")",1);
// setTimeout("stretchHV('" +divName +"'," +eval(initVSize+diff)+ "," +finalVSize+ +"'," +eval(initHSize+diff)+ "," +finalHSize+ "," +eval(steps-1)+ ")",1);
}
}
Thank you in advance.
4 1382
Welcome to TSDN.
It depends how you want to test it. Do you want it to run when you click on a button or when the page loads?
There should be a div on the page:
[HTML]<div id="yourid">some text</div>[/HTML]
Welcome to TSDN.
It depends how you want to test it. Do you want it to run when you click on a button or when the page loads?
There should be a div on the page:
[HTML]<div id="yourid">some text</div>[/HTML]
Hey Acoder, It doesn't say anything about a button in the whole script, so I'm just going to test it when the page loads. About the div, Yes there should be a DIV there. The thing is that this javaScript file is an external file. So I have to create a HTML file to test it, which means I have to call the JS file. And the problem I'm having is sending the DIV into the function and then getting the right vertical and horizontal value to see if it works in Firefox. Also what type of properties should I give the DIV for this test, just width and height or something else.
Thank you in advance.
Hey Acoder, It doesn't say anything about a button in the whole script, so I'm just going to test it when the page loads. About the div, Yes there should be a DIV there. The thing is that this javaScript file is an external file. So I have to create a HTML file to test it, which means I have to call the JS file. And the problem I'm having is sending the DIV into the function and then getting the right vertical and horizontal value to see if it works in Firefox. Also what type of properties should I give the DIV for this test, just width and height or something else.
Thank you in advance.
You can run the function on the click of a button, e.g. - <input type="button" onclick="functionname(parameters)">
Give the div a width, height and an id.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Geoff |
last post by:
When trying to focus a field in Firefox, I get the following error:
Error: " nsresult: "0x8057001e
(NS_ERROR_XPC_JS_THREW_STRING)" location: "JS frame ::...
|
by: code_wrong |
last post by:
Hi
Firefox does not support the IE specific 'event' identifier and just quits
running the script.
..... even though the identifier only turns up in code marked for IE only ...
Does this seem...
|
by: TJS |
last post by:
I am finding that the serverside requiredvalidator doesn't fire in the
firefox browser, and user request proceeds through to my updateProfile
method. Validation is working correctly in the IE...
|
by: John Abbler |
last post by:
I'm currently testing doing some testing with other browsers and have found
that my custom field validators aren't firing with Firefox or Netscape, but
they work fine with Ie.
Here's the code...
|
by: DamonChong |
last post by:
Hi,
Thanks alot in advance. I got the following two functions in my
javascript which work fine in Firefox 1.5 but not in IE6. Can someone
please help? Thank you again.
...
|
by: Jim |
last post by:
I had Firefox set as my default browser, but I wanted to change back to IE
when testing my webservices.
Easy enough....(in IE) Tools>Internet Options>Programs then check "Internet
Explorer...
|
by: WebMatrix |
last post by:
I've been developing ASP.NET 1.1 application, testing it in IE 6.0 on my
development machine. Of course, everything looks normal in IE as it should.
Well, since it's going to be released to...
|
by: =?Utf-8?B?Sm9obiBCYWlsZXk=?= |
last post by:
I have a ASP .Net page that allows moving around items on the page through
javascript. This page works fine in IE.
In FireFox however, I have found that if the page is using XHTML 1.0...
|
by: Gretsch |
last post by:
Re XML, Javascript, IE, Firefox
Hi,
I have a very simple & small XML file (only 7 variables). The code works for IE, but not for Firefox. I've search around and found lots of alternatives, but...
|
by: dmorand |
last post by:
I'm having a little trouble with my ajax. I can see my results in IE, but not firefox. I'm assuming I'm missing some syntax somewhere.
alert("Test " + results + testing); returns the values in...
|
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
|
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...
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
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: 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...
|
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...
|
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: 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...
| |