Help with a code problem?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 3 of 3

Thread: Help with a code problem?

  1. #1
    Join Date
    Aug 2004
    Posts
    2

    Help with a code problem?

    Hi, I'm hoping to get some help trying to figure out where, if any, there is an error in this code... it's for a site that looks fine in I.E. but doesn't look right in a Mozilla browser. The site in question is www.meomoa.com

    And here's the code that I think is in error, it's a menu script, by the way... any suggestions for what I might need to fix would be greatly appreciated.

    /****************************** Starts list of NS functions ****************************/
    /* set dummy layers with respect to main/sun */
    /* dynmic navigation from the main navigation*/
    function setNSSubLayers(c_cat,index, start_top, start_left, img0, img1)
    {
    setClearSubLayer(main_sub_cat_length);
    document.layers["tlayer"].visibility = "hide";
    var temp_sub_arr = getSubNavisOnly(c_cat); // array of sub navis
    if(main_sub_cat_length > 0)
    { //starts if-1 atlease on subnavis
    if(temp_sub_arr.length > 0)
    { //starts if-3
    f_str_dyn_sub_list = temp_sub_arr;
    ns_layers_height = 0;
    ns_sub_start_top = start_top;
    var position = index; //index
    for(var i=0;i<temp_sub_arr.length;i++)
    { //starts for loop
    //var lay="sub_layer_"+i;
    var layer_id = temp_sub_arr[i]; //array -temp
    var act_layer = 'act_' + layer_id; // active layer
    document.layers[layer_id].visibility = "show";
    document.layers[layer_id].top = ns_sub_start_top;
    document.layers[act_layer].top = ns_sub_start_top;
    document.layers[layer_id].left = start_left;
    document.layers[act_layer].left = start_left;
    img_over = img1;
    img_out = img0;
    document.layers[layer_id].background.src = img0;
    document.layers[act_layer].background.src = img1;
    // document.layers[layer_id].bgcolor="#12acacac";
    document.layers[layer_id].resizeTo(eval(common_width),eval(common_height));
    document.layers[act_layer].resizeTo(eval(common_width ),eval(common_height));
    ns_sub_start_top += ns_sub_inc_top+2;
    ns_layers_height += ns_sub_def_height + 2;
    position++;
    } //close for loop
    document.layers["tlayer"].visibility = "show";
    document.layers["tlayer"].resizeTo(eval(ns_sub_def_width + 40),eval(ns_layers_height + 40));
    document.layers["tlayer"].top = start_top - 5;
    // document.layers["tlayer"].left = start_left;
    if(location_identifier == 'r')
    document.layers["tlayer"].left = start_left-(eval(ns_sub_def_width/4));
    else if(location_identifier == 'l')
    document.layers["tlayer"].left = start_left; //document.layers["tlayer"].left = start_left - 40;
    else if(vertical_location == 'l')
    document.layers["tlayer"].left = start_left; //document.layers["tlayer"].left = start_left - 40;
    else if(vertical_location == 'r')
    document.layers["tlayer"].left = start_left-(eval(ns_sub_def_width/4));
    // document.layers["tlayer"].bgColor="#fafa00";
    document.layers["bglayer"].visibility = "show";
    document.layers["bglayer"].resizeTo(eval(ns_sub_def_width+4),eval(ns_layers_ height+1));
    document.layers["bglayer"].top = start_top-1;
    document.layers["bglayer"].left = start_left-1;
    document.layers["bglayer"].bgColor='#b2b2b2';
    } //close if -3
    } // over the if -1
    } // over the function

    function onSubNaviNSMouseOver(ilayer,slayer)
    {
    current_page_id = ''; //current page id
    current_url_status = ''; //current url

    ilayer.visibility ='hide';
    document.layers[slayer].visibility = 'show';
    document.layers[slayer].top = ilayer.top;
    document.layers[slayer].left = ilayer.left;
    document.layers[slayer].resizeTo(eval(common_width),eval(common_height));
    }
    /* Click to new link for NS */
    function getAction()
    {
    if(current_url_status == 'y' && current_page_id != '') //cursor points to page id
    {
    window.location.href = current_page_id + '.html';
    }
    else if(current_url_status == '' && current_page_id == '' )//cursor has no page id
    getTop();
    } // close the function

    /* clear all sub navigation */
    function setClearNSSubLayer(slength)
    {
    if(slength > 0)
    { //starts if - more than one navis
    for(var i=0;i<main_sub_cat_length;i++)
    { //starts for loop - run navis
    // var lay="sub_layer_"+i;
    var lay = main_sub_cat_arr[i].split(":"); // array layers
    var layi = lay[1]; //at position 2
    var layiact = 'act_' + lay[1]; //active layer
    document.layers[layi].visibility = "hide";
    document.layers[layiact].visibility = "hide";
    } //close the loop
    document.layers["bglayer"].visibility = "hide";
    } //close if
    } // close the function

  2. #2
    Join Date
    Aug 2004
    Posts
    2
    anyone?

  3. #3
    Join Date
    Jun 2004
    Posts
    199
    DHTML is problematic between IE and ____ because IE doesn't implement standards (other than Microsofts).

    I'm not a DHTML or Javascipt expert so I would need to spend sometime on it.

    So you might want to ask this question in the web technologies discussion group. I'm sure someone there would be able to answer. Not many of the frequent the Java (not Javascript) discussion area.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center