Sorry, I have found my mistake, but I cannot delete this post.
I have discovered by experiment that element.style.t op assignment in IE works with just a number on the right but in Firefox you have to put the unit too. Original code is below. Adding "+'px'" made it work in Firefox too. -
javascript
-
var fullsizeimage = document.getElementById('fullsizeimageframe');
-
if (!fullsizeimage) return false;
-
var coord = new Array(2);
-
coord = findPos(whichpic);
-
alert(coord[1]);
-
alert(fullsizeimage.offsetTop);
-
document.getElementById('fullsizeimageframe').style.top = coord[1];
-
alert(fullsizeimage.style.top);
-
.....
alert results IE: 162; -2; 162px (div moves)
alert results Firefox 2: 162; 0; blank (div doesn't move)
8 21465 gits 5,390
Recognized Expert Moderator Expert
hi ...
i think you have to set explicitly: - ele_ref.style.top = 'width px';
so add + 'px' to your set-statement ...
kind regards
gits 5,390
Recognized Expert Moderator Expert
congrats ;) you find it the same time for yourself ;)
kind regards
Yes, units are required for html and css as the standard so states.
acoder 16,027
Recognized Expert Moderator MVP
Sorry, I have found my mistake, but I cannot delete this post.
I'm sure this will help someone, so it makes sense not to delete it.
Hi friends,
I have faced same issues.But it not work for me in FF. In bellow my code even if ScollTop greater than 0 it is not work - var ScrollTop = document.body.scrollTop;
-
if (ScrollTop == 0)
-
-
{
-
-
if (window.pageYOffset)
-
-
ScrollTop = window.pageYOffset;
-
-
else
-
-
ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;
-
-
}
-
-
shadow.style.top = ScollTop +'px';
-
shadow.style.left = 0;
Sorry Guys. it work me too
acoder 16,027
Recognized Expert Moderator MVP
Welcome to Bytes. Glad you managed to solve it. I assume the problem was a mis-spelling.
PS. please remember to use [code] tags when posting code. Thanks.
i registered just to say u saved my day.
a million thanks!
Sign in to post your reply or Sign up for a free account.
Similar topics |
by: Jeff Gutsell |
last post by:
Occasionally, in creating a static page I have assigned two classes to
an element. For example: "class = 'BodyText Note'." It's a neat way
of streamlining my stylesheets.
However, I have never been able to use JavaScript to dynamically add a
second class to an element. I'm guessing that this involves some
string concatenation, and I must be making some silly mistake. The
type of approach I've tried has been:
theElement.className =...
|
by: lawrence |
last post by:
I've a graphic designer who wants to be able to see what he's styled
and what he so far hasn't. So I'd like to write a script that will
work in, say, FireFox, so that he can point FireFox at has websites
and the script will loop through the page after its loaded and perhaps
for each element do something like throw an alert() with the style
rules. I can call the style() method on each element to get its rules,
but how do I get every element?
|
by: abs |
last post by:
Hi all.
I use such code to clone blocks:
element = document.getElementById(IdOfElement)
element = element.cloneNode(true)
new_element = document.getElementById(IdOfElement).appendChild(element)
Anybody knows how to set id for the new element ? I mean the id which I coud
use in CSS stylesheet for setting css properties of new element.
|
by: Michael Bierman |
last post by:
Please forgive the simplicy of this question. I have the following code
which attempts to determine the color of some text and set other text
to match that color. It works fine in Firefox, but does nothing in IE.
I'd be greatful for any assistance. Also, if I will have problems the
code on Opera or Safari, I'd appreciate any pointers--I don't have a
Mac to test Safari.
THanks very much,
Michael
|
by: Mounir |
last post by:
Hi,
Assume that right and left are multiple select elements. It's about the
following line :
right.options=left.options;
It copies the content of left.options into right.options, but
*removes* the content of the first one !
| |
by: eholz1 |
last post by:
Hello ,
I have a web page that has a div element, with css applied to that
element.
Within the div is an ul with li tags, etc. the displayed font size in
IE is larger than the the font size in
firefox. Needless to say the code for the page in question is the
same.
I would like to font size to be the same for both browsers.
|
by: Sunny |
last post by:
Hi,
I am creating an Element on page in Firefox.
But It gives me an error in Firefox.
String contains an invalid character" code: "5
county = document.createElement('"' +
countyVMLtext + '"');
I am adding a SVG shape to the page.
Here is the Shape :
|
by: Sunny |
last post by:
Hi, I can change the lement opacity in IE using.
abc.style.filter = 'alpha(opacity=' + 10 + ')';
But this dont work in firefox, In firefox it throws error.
How I can change the opacity of an element in Firefox.
|
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: 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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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: 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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
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
| |