Pagina 1 di 2 1 2 ultimoultimo
Visualizzazione dei risultati da 1 a 10 su 12
  1. #1
    Utente di HTML.it L'avatar di ravint
    Registrato dal
    Jul 2000
    Messaggi
    332

    Compatibilita Firefox 2.0

    Se ne è parlato tanto in questo forum tuttavia il mio problema credo sia diverso....
    Il mio sito con firefox si vede, tutte le tabelle sono al loro posto, il sito lo fatto tutto con dreamweaver 8.0, il solo problema risiede nel menu che lo creato che qui riporto lo script che si vede con gli altri browser mentre con firefox non succede nulla:

    nella pagina html:

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    if (ver4) {
    menuWidth = 100;
    childOverlap = 0;
    childOffset = 0;
    perCentOver = null;
    secondsVisible = 0.5;
    fntCol = "black";
    overFnt = "white";
    fntSiz = "10px";
    fntWgh = "normal";
    fntSty = "normal";
    fntFam = "verdana";
    backCol = "#FCBF02";
    overCol = "#433EE0";
    linHgt = "normal";
    borWid = 1;
    borCol = "#000000"
    borSty = "outset";
    imgSrc = "/images/bullet_blocktriangle_red.gif";
    imgSiz = 7;

    }
    //-->
    </SCRIPT>

    <SCRIPT LANGUAGE="JavaScript">
    <!--
    if (ver4) {
    document.write("<SCRIPT LANGUAGE='JavaScript' SRC='arrays.js'><\/SCRIPT>");
    document.write("<SCRIPT LANGUAGE='JavaScript' SRC='menu.js'><\/SCRIPT>");
    }
    -->
    </script>

    un file Array dove risiedono i link
    -----------------------------------
    e un file dove risiede un codice (scuate la lunghezza):


    if (perCentOver != null) {
    childOverlap = (perCentOver/100) * menuWidth
    }
    mSecsVis = secondsVisible*1000;

    semi = ";";
    styleStr = "<STYLE TYPE='text/css'>"
    styleStr += ".items {"
    styleStr += "width:" + menuWidth + semi
    styleStr += "color:"+ fntCol + semi
    styleStr += "font-size:"+ fntSiz + semi
    styleStr += "font-weight:"+ fntWgh + semi
    styleStr += "font-style:"+ fntSty + semi
    styleStr += "font-family:"+ fntFam + semi
    styleStr += "border-width:" + borWid + semi
    styleStr += "border-color:" + borCol + semi
    styleStr += "border-style:" + borSty + semi
    styleStr += "line-height:" + linHgt + semi
    styleStr += "}"
    styleStr += "</STYLE>";

    document.write(styleStr);

    imgStr = "[img] + imgSrc + [/img]"

    topCount = 1;
    areCreated = false;
    isOverMenu = false;
    currentMenu = null;
    allTimer = null;

    function menuSetup(hasParent,lastItem,openCont,openItem) {

    this.menuOver = menuOver;
    this.menuOut = menuOut;

    this.onmouseover = this.menuOver;
    this.onmouseout = this.menuOut;

    this.showIt = showIt;
    this.keepInWindow = keepInWindow;

    this.hideTree = hideTree
    this.hideParents = hideParents;
    this.hideChildren = hideChildren;
    this.hideTop = hideTop;

    this.hasChildVisible = false;
    this.isOn = false;

    this.hideTimer = null;

    if (hasParent) {
    this.hasParent = true;
    this.parentMenu = openCont;
    this.parentItem = openItem;
    this.parentItem.child = this;
    }
    else {
    this.hasParent = false;
    this.hideSelf = hideSelf;
    }

    if (NS4) {
    this.fullHeight = lastItem.top + lastItem.document.height;
    this.clip.bottom = this.fullHeight;
    }
    else {
    this.fullHeight = lastItem.style.pixelTop + lastItem.offsetHeight;
    this.showIt(false);
    this.onselectstart = cancelSelect;
    this.moveTo = moveTo;
    this.moveTo(0,0);
    }
    }

    function itemSetup(arrayPointer,whichArray) {

    this.itemOver = itemOver;
    this.itemOut = itemOut;
    this.onmouseover = this.itemOver;
    this.onmouseout = this.itemOut;

    this.dispText = whichArray[arrayPointer];
    this.linkText = whichArray[arrayPointer + 1];
    this.hasMore = whichArray[arrayPointer + 2];

    if (this.linkText.length > 0) {
    this.linkIt = linkIt;
    if (NS4) {
    this.onfocus = this.linkIt;
    }
    else {
    this.onclick = this.linkIt;
    this.style.cursor = "hand";
    }
    }

    if (this.hasMore) {
    htmStr = imgStr + this.dispText;
    }
    else {
    htmStr = this.dispText;
    }

    if (NS4) {
    layStr = "<SPAN CLASS=items>" + htmStr+ "</SPAN>";
    this.document.write(layStr);
    this.document.close();

    this.bgColor = backCol;
    this.clip.right = menuWidth;
    this.visibility = "inherit";
    this.container = this.parentLayer;

    if (arrayPointer == 0) {
    this.top = 0;
    }
    else {
    this.top = this.prevItem.top + this.prevItem.document.height - borWid;
    }
    this.left = 0;
    }
    else {
    this.className = "items";
    this.style.padding = 3;
    this.innerHTML = htmStr;

    this.style.backgroundColor = backCol;
    this.container = this.offsetParent;

    if (arrayPointer == 0) {
    this.style.pixelTop = 0;
    }
    else {
    this.style.pixelTop = this.prevItem.style.pixelTop + this.prevItem.offsetHeight - borWid;
    }
    this.style.pixelLeft = 0;
    }
    }

    function makeElement(whichEl,whichContainer) {
    if (arguments.length==1)
    whichContainer = (NS4) ? window : document.body;

    if (NS4) {
    eval(whichEl + "= new Layer(menuWidth,whichContainer)");
    }
    else {
    elStr = "<DIV ID=" + whichEl + " STYLE='position:absolute'></DIV>";
    whichContainer.insertAdjacentHTML("BeforeEnd",elSt r);
    }

    return eval(whichEl);
    }

    function makeTop() {
    while(eval("window.arMenu" + topCount)) {
    topArray = eval("arMenu" + topCount);
    topName = "elMenu" + topCount;

    topMenu = makeElement(topName);
    topMenu.setup = menuSetup;

    topItemCount = 0;
    for (i=0; i<topArray.length; i+=3) {
    topItemCount++;
    status = " - © Copyright 2004 Portofinodive.com - All rights reserved : " + topCount + " / " + topItemCount;
    topItemName = "item" + topCount + "_" + topItemCount;
    topItem = makeElement(topItemName,topMenu);

    if (topItemCount >1)
    topItem.prevItem = eval("item" + topCount + "_" + (topItemCount-1));

    topItem.setup = itemSetup;
    topItem.setup(i,topArray);

    if (topItem.hasMore) makeSecond();
    }

    topMenu.setup(false,topItem);
    topCount++
    }

    status = (topCount-1) + " - © Copyright 2004 Portofinodive.com - All rights reserved "
    areCreated = true;
    }

    function makeSecond() {

    secondCount = topCount + "_" + topItemCount;

    secondArray = eval("arMenu" + secondCount);
    secondName = "elChild" + secondCount;

    secondMenu = makeElement(secondName);
    secondMenu.setup = menuSetup;

    secondItemCount=0;
    for (j=0; j<secondArray.length; j+=3) {
    secondItemCount++;
    secondItemName = "item" + secondCount +"_" + secondItemCount;

    secondItem = makeElement(secondItemName,secondMenu)

    if (secondItemCount >1)
    secondItem.prevItem = eval("item" + secondCount + "_" + (secondItemCount-1));

    secondItem.setup = itemSetup;
    secondItem.setup(j,secondArray);

    if (secondItem.hasMore) makeThird();
    }

    secondMenu.setup(true,secondItem,topMenu,topItem);
    }

    function makeThird() {
    thirdCounter = secondCount + "_" + secondItemCount

    thirdArray = eval("arMenu" + thirdCounter);
    thirdName = "elGrandChild" + thirdCounter;
    thirdMenu = makeElement(thirdName)

    thirdMenu.setup = menuSetup;

    thirdItemCount=0;
    for (k=0; k<thirdArray.length; k+=3) {
    thirdItemCount++;
    thirdItemName = "item" + thirdCounter + "_" + thirdItemCount;
    thirdItem = makeElement(thirdItemName,thirdMenu);

    if (thirdItemCount >1)
    thirdItem.prevItem = eval("item" + thirdCounter + "_" +(thirdItemCount-1));

    thirdItem.setup = itemSetup;
    thirdItem.setup(k,thirdArray);

    }

    thirdMenu.setup(true,thirdItem,secondMenu,secondIt em);
    }

    function linkIt() {
    location.href = this.linkText;
    }

    function showIt(on) {
    if (NS4) {this.visibility = (on) ? "show" : "hide"}
    else {this.style.visibility = (on) ? "visible" : "hidden"}
    }

    function keepInWindow() {
    scrBars = 20;

    if (NS4) {
    winRight = (window.pageXOffset + window.innerWidth) - scrBars;
    rightPos = this.left + menuWidth;

    if (rightPos > winRight) {
    if (this.hasParent) {
    parentLeft = this.parentMenu.left;
    newLeft = ((parentLeft-menuWidth) + childOverlap);
    this.left = newLeft;
    }
    else {
    dif = rightPos - winRight;
    this.left -= dif;
    }
    }

    winBot = (window.pageYOffset + window.innerHeight) - scrBars;
    botPos = this.top + this.fullHeight;

    if (botPos > winBot) {
    dif = botPos - winBot;
    this.top -= dif;
    }
    }
    else {
    winRight = (document.body.scrollLeft + document.body.clientWidth) - scrBars;
    rightPos = this.style.pixelLeft + menuWidth;

    if (rightPos > winRight) {
    if (this.hasParent) {
    parentLeft = this.parentMenu.style.pixelLeft;
    newLeft = ((parentLeft - menuWidth) + childOverlap);
    this.style.pixelLeft = newLeft;
    }
    else {
    dif = rightPos - winRight;
    this.style.pixelLeft -= dif;
    }
    }

    winBot = (document.body.scrollTop + document.body.clientHeight) - scrBars;
    botPos = this.style.pixelTop + this.fullHeight;

    if (botPos > winBot) {
    dif = botPos - winBot;
    this.style.pixelTop -= dif;
    }
    }
    }

    function popUp(menuName,e){
    if (!areCreated) return;

    hideAll();

    currentMenu = eval(menuName);
    xPos = (NS4) ? e.pageX : event.x;
    yPos = (NS4) ? e.pageY : event.y;
    currentMenu.moveTo(xPos,yPos);

    currentMenu.keepInWindow()
    currentMenu.isOn = true;
    currentMenu.showIt(true);
    }

    function popDown(menuName){
    if (!areCreated) return;
    whichEl = eval(menuName);
    whichEl.isOn = false;
    whichEl.hideTop();
    }

    function menuOver() {
    this.isOn = true;
    isOverMenu = true;
    currentMenu = this;
    if (this.hideTimer) clearTimeout(this.hideTimer);
    }

    function menuOut() {
    if (IE4 && event.srcElement.contains(event.toElement)) return;
    this.isOn = false;
    isOverMenu = false;
    if (IE4) allTimer = setTimeout("currentMenu.hideTree()",10);
    }

    function itemOver(){
    if (IE4 && event.srcElement.tagName == "IMG") return;

    if (NS4) {
    this.bgColor = overCol;
    }
    else {
    this.style.backgroundColor = overCol;
    this.style.color = overFnt;
    }

    if (this.container.hasChildVisible) {
    this.container.hideChildren(this);
    }

    if(this.hasMore) {
    if (NS4) {
    this.childX = this.container.left + (menuWidth - childOverlap);
    this.childY = this.pageY + childOffset;
    }
    else {
    this.childX = this.container.style.pixelLeft + (menuWidth - childOverlap);
    this.childY = this.style.pixelTop + this.container.style.pixelTop + childOffset;
    }

    this.child.moveTo(this.childX,this.childY);
    this.child.keepInWindow();
    this.container.hasChildVisible = true;
    this.container.visibleChild = this.child;
    this.child.showIt(true);
    }
    }


    function itemOut() {
    if (IE4 && (event.srcElement.contains(event.toElement)
    || (event.fromElement.tagName=="IMG" && event.toElement.contains(event.fromElement))))
    return;

    if (NS4) {
    this.bgColor = backCol;
    if (!isOverMenu) {
    allTimer = setTimeout("currentMenu.hideTree()",10);
    }
    }
    else {
    this.style.backgroundColor = backCol;
    this.style.color = fntCol;
    }
    }

    function hideAll() {
    for(i=1; i<topCount; i++) {
    temp = eval("elMenu" + i);
    temp.isOn = false;
    if (temp.hasChildVisible) temp.hideChildren();
    temp.showIt(false);
    }
    }

    function hideTree() {
    allTimer = null;
    if (isOverMenu) return;
    if (this.hasChildVisible) {
    this.hideChildren();
    }
    this.hideParents();
    }

    function hideChildren(item) {
    if (this.visibleChild.hasChildVisible) {
    this.visibleChild.visibleChild.showIt(false);
    this.visibleChild.hasChildVisible = false;
    }

    if (!this.isOn || !item.hasMore || this.visibleChild != this.child) {
    this.visibleChild.showIt(false);
    this.hasChildVisible = false;
    }
    }

    function hideParents() {

    if (this.hasParent) {
    this.showIt(false);
    if (this.parentMenu.hasParent) {
    this.parentMenu.isOn = false;
    this.parentMenu.showIt(false);
    this.parentMenu.parentMenu.isOn = false;
    whichEl = this.parentMenu.parentMenu
    }
    else {
    this.parentMenu.isOn = false;
    whichEl = this.parentMenu;
    }
    }
    else {
    whichEl = this;
    }

    whichEl.hideTop();
    }

    function hideTop() {
    whichEl = this;
    this.hideTimer = setTimeout("whichEl.hideSelf()",mSecsVis);
    }

    function hideSelf() {
    this.hideTimer = null;
    if (!this.isOn && !isOverMenu) {
    this.showIt(false);
    }
    }

    function cancelSelect(){return false}

    function moveTo(xPos,yPos) {
    this.style.pixelLeft = xPos;
    this.style.pixelTop = yPos;
    }

    window.onload = makeTop;


    CHE POSSO FARE???????

  2. #2

    Re: Compatibilita Firefox 2.0

    Originariamente inviato da ravint
    tutte le tabelle sono al loro posto
    le tabelle non vanno usate per il layout ma per contenere dati tabellari, cioè in corrispondenza riga-colonna.

    Originariamente inviato da ravint
    il sito lo fatto tutto con dreamweaver 8.0
    ah ecco perchè. dreamweaver ti aiuta a scrivere codice (e italiano) sporco.


    Originariamente inviato da ravint
    il solo problema risiede nel menu
    tutto quel codice per fare cosa? sicuro di non poterlo fare anche con i CSS? posta il link alla pagina e la prossima volta usa il tag code per rendere il codice leggibile.

  3. #3
    Ma soprattutto: Firefox ti darà degli errori, no? Hai provato ad installare FireBug e verificare esattamente quali errori ci sono nella console JavaScript?

    Ciao!
    "Le uniche cose che sbagli sono quelle che non provi a fare."
    Atipica

  4. #4
    Utente di HTML.it L'avatar di ravint
    Registrato dal
    Jul 2000
    Messaggi
    332
    ok grazie... ma il sito credo funzioni bene il problema e solo sul menu che non ho fatto altro che prendere un javaScript già pronto su html alcuni anni fa e adattarlo alla mio sito.
    Quindi non fa parte del sito ma e' una cosa esterna.....
    Tutto il resto lo fatto si con Dreamweaver pero' io lo vedo correttamente con firefox, almeno....... ho installato proprio ora firefox e l'unico problema che mi ha dato sono i menu che non funzionano.....

    il link e' questo
    http://www.portofinodive.com

  5. #5
    Perdonami, ma con 40 errori di validazione, tra cui anche alcuni che riguardano i tag script, come speri che funzioni?

    http://validator.w3.org/check?verbos...isiamo.html%23

    Risolvi gli errori di validazione e poi ne riparliamo
    "Le uniche cose che sbagli sono quelle che non provi a fare."
    Atipica

  6. #6
    Utente di HTML.it L'avatar di ravint
    Registrato dal
    Jul 2000
    Messaggi
    332
    scusa ma allora non ho capito.... come li vedi te questi errori....

    io nel browser firefox vedo tutto bene al proprio posto come negli altri...... non mi funziona solo il menu........

    ho provato a installare firebug ma non ho capito come funziona...

    :master:

  7. #7
    Originariamente inviato da ravint
    scusa ma allora non ho capito.... come li vedi te questi errori....

    io nel browser firefox vedo tutto bene al proprio posto come negli altri...... non mi funziona solo il menu........

    ho provato a installare firebug ma non ho capito come funziona...

    :master:
    Basta cliccare il link che ho postato per vedere tutti gli errori di validazione....
    "Le uniche cose che sbagli sono quelle che non provi a fare."
    Atipica

  8. #8
    Utente di HTML.it L'avatar di ravint
    Registrato dal
    Jul 2000
    Messaggi
    332
    si ho visto, scusa sai ok ci sono degli errori che per altro alcuni non ho capito come correggerli.....ma quelli non centrano nulla con lo script del menu......

    vai a leggere il codice del menu che risiede su un altro file esterno alle pagine html.
    Sulle pagine html c'e' solo il codice di richiamo dei 2 file che gestiscono il menu....

    il problema che su quel codice c'e' la parte sulla compatibilita di alcuni browser ma non so come inserire quello di firefox....

  9. #9
    Diamine, ci sono errori nei tag <script> che contengono del js, come pensi possano non avere influenze sul resto del funzionamento di js...

    E comunque, lo script che hai inserito è un mostro storico di complessità immane, che addirittura contiene delle parti per Netscape 4 (Netscape 4! un browser del 1998, capisci, 1998... sono passati quasi 10 anni e nessuno lo usa più!) e non credo che nessuno vorrà mettersi a cercare per te quale sia lo specifico bug che potrebbe anche essere causato dalla compresenza di due diversi script nella stessa pagina...

    O cerchi di capire tu dove si trova, procedendo per gradi, correggendo prima l'html, poi verificando che i javascript non diano errori, e poi andandoti a capire come funziona quella mostruosità di JS che hai usato, e magari mettendo il menu da solo in una pagina di test, o non riuscirai nel tuo intento...

    Per capirci, non è cattiva volontà, ma per debuggare un menu in js di 9 anni fa, ci vuole una MAREA di tempo: se dovessi valutare a spanne direi non meno di DIECI ore lavorative, per fare una cosa che non ha senso...

    Senza contare che per come sono fatti i motori di ricerca, quel menu solo in javascript è un invito ad ignorare tutte le pagine interne del sito...

    Insomma, personalmente mi sento di consigliarti di rivedere completamente il modo in cui costruisci quel menu...
    "Le uniche cose che sbagli sono quelle che non provi a fare."
    Atipica

  10. #10
    Utente di HTML.it L'avatar di ravint
    Registrato dal
    Jul 2000
    Messaggi
    332
    ok ho capito.....

    pero' sarà di 9 anni fa ma mi permette di gestire un montagna di link in un unico file senza dover modificare una montagna di pagine.....

    Motore di ricerca... pensa che il nostro sito e tra i primi nelle liste dei motori di ricerca e il 70% dei clienti ci contatta tramite internet....

    comunque grazie per le dritte, vedrò cosa posso fare......

    Sai mica se in giro c'e' un sistema dei menu piu' moderno simile al mio???


    grazie ancora

    ciao

Permessi di invio

  • Non puoi inserire discussioni
  • Non puoi inserire repliche
  • Non puoi inserire allegati
  • Non puoi modificare i tuoi messaggi
  •  
Powered by vBulletin® Version 4.2.1
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved.