SitePoint Sponsor

User Tag List

Results 1 to 5 of 5

Hybrid View

  1. #1
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Firefox undoing Javascript

    Hi everyone,

    Not sure if anybody has any clues at all about this, but whenever I run any of my Javascript functions in the application I am working on, Firefox undoes the effects of the Javascript about half a second after it finishes executing.

    for example, if I remove a Div and replace it with another, the change shows up for a split second and then reverts to it's old state again. This is happening in a whole range of functions.

    Has anybody ever come across this?

    Regards,
    Jordan

  2. #2
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Does anybody have any ideas at all pease? This is insane...

  3. #3
    SitePoint Wizard Pepejeria's Avatar
    Join Date
    Jan 2005
    Location
    Too far up north
    Posts
    1,566
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Please show some code, it will otherwise be impossible to guess what you have coded

  4. #4
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry Pepejeria, I should have done that.
    Code:
    function resizeImage()
    {
      var d = document.getElementById('divContent');
      var c = document.getElementById('imgChart');
      
      var dH = d.offsetHeight;
      var dW = d.offsetWidth;
      
      var cH = c.offsetHeight;
      var cW = c.offsetWidth;
      var cR = cW/cH;
    
      var difH = dH - cH;
      var difW = dW - cW;
    
      var newH = cH + difH;
      var newW = cW + (difH * cR);
    
      c.height = newH;
      c.width = newW;
    }
    When I click the button that calls this funtion, it works fine in IE. In Firefox, it resizes and then a moment later unodes the change and puts the image back to it's original size.

    I have a number of functions where this is occuring.

    Regards,
    Jordan

  5. #5
    I ♥ PHP
    Join Date
    Jul 2003
    Location
    Melbourne, Australia
    Posts
    579
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Scrap that, it must have been my Firefox, because today it is all fine. How satrange!!!

    Sorry everyone.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •