Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Dec 2007
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts

    problem with opera browser

    hi - i have any code for dtree menu . this script work with mozila - IE 7 but not work with opera browser .
    THIS CODE :
    <script>
    var gEBI = (document.getElementById) ? true : false;
    var da = (document.all) ? true : false;
    var lay = (document.layers) ? true : false;

    function Menu(ID)
    {
    var ktgID = "ktg_" + ID;
    var imgID = "img_" + ID;

    if (gEBI)
    {
    ktgID = document.getElementById(ktgID);
    imgID = document.getElementById(imgID);
    //alert("gEBI");
    }
    else
    {
    if (da)
    {
    ktgID = document.all(ktgID);
    imgID = document.all(imgID);
    //alert("da");
    }
    else
    {
    if (lay)
    {
    //alert("lay");
    //KtgID = document.layers(ktgID);
    //imgID = document.layers(imgID);
    }
    else
    {
    alert("Sorry, your browser does not support this page!");
    }
    }
    }
    if (gEBI || da)
    {
    if (ktgID.style.display == "none")
    {
    ktgID.style.display = "block";
    imgID.src = "images/minus.gif";
    }
    else
    {
    ktgID.style.display = "none";
    imgID.src = "images/plus.gif";
    }
    }
    else
    {
    if (document.layers["ktg_"+ID].visibility == "hide")
    {
    document.layers["ktg_"+ID].visibility = "show";
    // imgID.src = "images/minus.gif";
    }
    else
    {
    document.layers["ktg_"+ID].visibility = "hide";
    // imgID.src = "images/plus.gif"
    }
    }

    }

    var agt=navigator.userAgent.toLowerCase();
    var is_major = parseInt(navigator.appVersion);
    var is_nav = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
    && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
    && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_ie = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie4up = (is_ie && (is_major >= 4));
    if (!(is_nav6up || is_ie4up))
    {
    document.location.href = "categories.php";
    }
    </script>
    SO FOR SHOW
    echo "<IMG ID='img_$i' SRC='images/plus.gif' border='0' onClick='javascript: Menu($i);'>";

    echo "<a href='#' class='Menu' onClick='javascript: Menu($i);'><B>$row[0]</B></a><br>";

    echo "<span id='ktg_$i' style='display:none;'>";

    $result2 = mysql_query("select DISTINCT maingroup, secondgroup from products WHERE maingroup = '$row[0]' ORDER BY secondgroup");

    while($row = mysql_fetch_row($result2)) {

    echo "&nbsp;&nbsp;&nbsp;<IMG SRC=\"images/dots.gif\" border=\"0\" WIDTH=\"7\" HEIGHT=\"9\">&nbsp;<a class=\"menu\" href=\"#\" onclick=\"javascriptage_loader('item_list.php?maingroup=$row[0]&secondgroup=$row[1]&sort=item')\">$row[1]</a><br>";

    $i=$i+1;

    }

    echo "</span>";

    }

    This Script a Dtree Menu For Group list . . . But Not work In Opera . Dont Show Image !! And Dont Work Expand . . What's Problem ??

  • #2
    Supreme Master coder! _Aerospace_Eng_'s Avatar
    Join Date
    Dec 2004
    Location
    In a place far, far away...
    Posts
    19,291
    Thanks
    2
    Thanked 1,043 Times in 1,019 Posts
    Where did you get the script from? That script you have looks outdated. There are a few menus here that might interest you that work in
    Opera.

    http://destroydrop.com/javascripts/tree/
    Last edited by _Aerospace_Eng_; 12-22-2007 at 05:22 PM.
    ||||If you are getting paid to do a job, don't ask for help on it!||||

  • #3
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    I agree with _Aerospace_Eng_,

    Any script that uses document.all or document.layers is usually a sign to look for something else. Only browser that really supports document.layers is 9? years old.

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #4
    New Coder
    Join Date
    Dec 2007
    Posts
    59
    Thanks
    0
    Thanked 0 Times in 0 Posts
    hi . this nice script . this script for static page . how to change this script for dynamic page and link ?? Example : for add a category in admin panel = generate auto link in dtree menu . thx


  •  

    Posting Permissions

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