Results 1 to 3 of 3

Thread: Script working/not working in Firefox

  1. #1
    Join Date
    Nov 2005
    Posts
    40
    Thanks
    0
    Thanked 1 Time in 1 Post

    Default Script working/not working in Firefox

    I have http://scriptasylum.com/misc/percent...rcent_bar.html on http://newsalesparadigm.com/expediter/pretest.php

    Now, on scriptasylum's site, it works, but when I use it, it doesn't work in firefox. Works fine in IE, can anyone tell me why it is doing this?

  2. The Following User Says Thank You to SawnDiddle For This Useful Post:

    maishatsana (03-27-2008)

  3. #2
    Join Date
    Mar 2008
    Posts
    2
    Thanks
    1
    Thanked 0 Times in 0 Posts

    Default

    Hello,

    IE works with percentages and mozilla works with pixels. Try giving pixel value u run it in firefox.

    Thanks & Regards

    Maishat Sana

  4. #3
    Join Date
    Sep 2005
    Location
    India
    Posts
    1,626
    Thanks
    6
    Thanked 107 Times in 107 Posts

    Default

    Two problems in your page:

    1. You need to include the following script file inclusion at the top of your page. The <head> section is a good place to do that.

    Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="http://www.w3.org/1999/xhtml"><head>
    
    
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><title>Expediter</title>
    
    <link href="pretest.php_files/style.css" rel="stylesheet" type="text/css">
    <script language="javascript" src="percent_bar.js"></script>
    </head>
    Plz note that the above is your source I just copied it to make my point.

    (2) You need to adjust the JavaScript a little bit in the percent_bar.js file

    Code:
    function clipid(id,t,r,b,l){
    
    if(ns4){
    id.clip.left=l;
    id.clip.top=t;
    id.clip.right=r;
    id.clip.bottom=b;
    }else id.style.width = r + "%";
    }
    
    I've highlighted the change I've made if you specify the CSS dimension property like width, height, etc if the value is a non-zero then you need to specify the measure in which you need to set the property for example 'px', '%', 'em', etc. In this case I've used '%' but if you want you can set it to 'px' once you do that the script will start working.

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
  •