Visualizzazione dei risultati da 1 a 4 su 4

Discussione: js piccola finestra

  1. #1
    Utente di HTML.it L'avatar di allejo
    Registrato dal
    Jul 2001
    Messaggi
    747

    js piccola finestra

    visitate questo sito: http://www.secondamano.it/Appartamento/341/index3.html

    come ha fatto a fare la piccola finestra quando l'utente visita sul <td> su come oggetto: "L.go la foppa adiacenze, grazioso open-space mq.45 c.a., bagno, parque...... " nella griglia

    Mi sapete aiutarmi?

    Ho guardato il codice ma non ci capisco nulla!!!!!
    Che nervosismo!
    Ciauz
    Allejo

  2. #2
    Utente di HTML.it
    Registrato dal
    Aug 2002
    Messaggi
    8,013
    Ciao, sono tooltips personalizzati. Se fai una ricerca con tooltip o tooltips come parola chiave in "Risorse per Webmaster" dovresti trovare diversi thread in cui se ne parla.

    ciao.
    <´¯)(¯`¤._)(¯`»ANDREA«´¯)(_.¤´¯)(¯`>
    "The answer to your question is: welcome to tomorrow"

  3. #3
    Ciao, grandiosi i tooltip!
    io ho copiato questo codice e modificato (per quel poco che capisco di javascript...)e funziona alla perfezione

    __________________________________________________ ___________________
    function lib_bwcheck(){ //Browsercheck
    this.ver=navigator.appVersion
    this.agent=navigator.userAgent
    //alert('this.ver '+ this.ver + ' this.agent ' + this.agent);
    this.dom=document.getElementById?1:0
    this.opera5=this.agent.indexOf("Opera 5")>-1
    this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0;
    this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;
    this.ie4=(document.all && !this.dom && !this.opera5)?1:0;
    this.ie=this.ie4||this.ie5||this.ie6
    this.mac=this.agent.indexOf("Mac")>-1
    this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0;
    this.ns4=(document.layers && !this.dom)?1:0;
    this.bw=(this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)
    return this
    }

    var bw=new lib_bwcheck()
    messages= new Array()

    messages[0]="qui ci scrivi quello che ti pare"
    messages[1]="qui ci scrivi quello che ti pare"
    messages[2]="qui ci scrivi quello che ti pare."
    messages[3]=" "
    messages[4]=" "
    messages[5]=" "
    messages[6]=" "
    messages[7]=" "
    messages[8]=" "
    messages[9]=" "
    messages[10]=" "
    messages[11]=" "
    messages[12]=" "
    messages[13]=" "
    messages[14]=" "
    messages[15]=" "
    messages[16]=" "
    messages[17]=" "
    messages[18]=" "
    messages[19]=" "
    messages[20]=" "
    messages[21]=" "
    messages[22]=" "


    fromX= 15
    fromY= 16
    ns4center= 1
    if (bw.ie)
    {useFading= 1}
    else useFading= 0;
    animation= 1
    detectiontype= 0
    delay= 100

    var px = bw.ns4||window.opera?"":"px";
    if(document.layers){ //NS4 resize fix.
    scrX= innerWidth; scrY= innerHeight;
    onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} };
    }

    function makeTooltip(obj){
    this.elm= document.getElementById? document.getElementById(obj):bw.ie4?document.all[obj]:bw.ns4?document.layers[obj]:0;
    this.css= bw.ns4?this.elm:this.elm.style;
    this.wref= bw.ns4?this.elm.document:this.elm;
    this.obj= obj+'makeTooltip'; eval(this.obj+'=this');
    this.w= bw.ns4? this.elm.clip.width: this.elm.offsetWidth;
    this.h= bw.ns4? this.elm.clip.height: this.elm.offsetHeight;
    };
    makeTooltip.prototype.measureIt= function(){
    this.w= bw.ns4? this.elm.clip.width: this.elm.offsetWidth;
    this.h= bw.ns4? this.elm.clip.height: this.elm.offsetHeight;
    };
    makeTooltip.prototype.writeIt= function(text){
    if (bw.ns4) {this.wref.write(text); this.wref.close()}
    else this.wref.innerHTML= text;
    };
    // Mousemove detection
    var mouseX=0,mouseY=0,setX=0,setY=0;
    function getMousemove(e){
    mouseX= (bw.ns4||bw.ns6)? e.pageX: bw.ie&&bw.win&&!bw.ie4? (event.clientX-2)+document.body.scrollLeft : event.clientX+document.body.scrollLeft;
    mouseY= (bw.ns4||bw.ns6)? e.pageY: bw.ie&&bw.win&&!bw.ie4? (event.clientY-2)+document.body.scrollTop : event.clientY+document.body.scrollTop;
    if (isLoaded && hovering && animation) placeIt();
    };
    function placeIt(){
    if (detectiontype==1) setX= mouseX+fromX+tooltip.w > screenWscrolled ? screenWscrolled-tooltip.w: mouseX+fromX;
    if (detectiontype==1) setY= mouseY+fromY+tooltip.h > screenHscrolled ? screenHscrolled-tooltip.h: mouseY+fromY;
    if (detectiontype==0) setX= mouseX+fromX+tooltip.w > screenWscrolled ? mouseX-fromX-tooltip.w: mouseX+fromX;
    if (detectiontype==0) setY= mouseY+fromY+tooltip.h > screenHscrolled ? mouseY-fromY-tooltip.h: mouseY+fromY;
    if (setX<0) setX= 0;
    if (setY<0) setY= 0;
    tooltip.css.left= setX+px;
    tooltip.css.top= setY+px;
    };
    // Main popUp function.
    var hovering=false, screenWscrolled=0, screenHscrolled=0;
    makeTooltip.prototype.showTimer= null;
    function popUp(num){
    if(isLoaded){
    clearTimeout(tooltip.popTimer);
    dopopOut();
    if (bw.ns4){
    var text= '<span class="netscape4Style">' + (ns4center?'<center>':"") + messages[num] + (ns4center?'</center>':"") + '</span>';
    tooltip.writeIt(text);
    }
    if (!bw.ns4) tooltip.writeIt(messages[num]);
    screenWscrolled= screenW + (bw.ie?document.body.scrollLeftageXOffset);
    screenHscrolled= screenH + (bw.ie?document.body.scrollTopageYOffset);
    hovering= true;

    /* I'm using a timeout for ie4 here, because it doesn't store the measurements quickly enough. Does anybody know why this happens? */
    if (bw.ie4) setTimeout('tooltip.measureIt(); placeIt();', delay/2);
    else { tooltip.measureIt(); placeIt(); }
    if (useFading) tooltip.showTimer= setTimeout('tooltip.blendIn()', delay);
    if (!useFading) tooltip.showTimer= setTimeout('tooltip.css.visibility="visible"', delay);
    }
    };
    // Hiding routines
    makeTooltip.prototype.popTimer= null;
    function popOut(){
    if (isLoaded) tooltip.popTimer= setTimeout('dopopOut()', 30)
    };
    function dopopOut(){
    hovering= false;
    clearTimeout(tooltip.showTimer);
    tooltip.css.visibility= 'hidden';
    clearTimeout(tooltip.fadeTimer);
    tooltip.i= 0;
    };
    // Measure screensize.
    var scrollbarWidth= bw.ns6&&bw.win?14:bw.ns6&&!bw.win?16:bw.ns4?16:0;
    function measureScreen() {
    tooltip.css.top= 0+px;
    tooltip.css.left= 0+px;
    screenW= (bw.ie?document.body.clientWidth:innerWidth) - scrollbarWidth;
    screenH= (bw.ie?document.body.clientHeight:innerHeight);
    };
    // Opacity methods.
    makeTooltip.prototype.blendIn= function(){
    if (bw.ie && bw.win && !bw.ie4) {
    this.css.filter= 'blendTrans(duration=0.5)';
    this.elm.filters.blendTrans.apply();
    this.css.visibility= 'visible';
    this.elm.filters.blendTrans.play();
    }
    else {
    this.css.visibility= 'visible';
    if (!bw.ns4) this.fadeIt();
    }
    };
    makeTooltip.prototype.step= 8;
    makeTooltip.prototype.i= 0;
    makeTooltip.prototype.fadeTimer= null;
    makeTooltip.prototype.fadeIt= function(){
    this.i+= this.step;
    //this.css.filter= 'alpha(opacity='+this.i+')';
    this.css.MozOpacity= this.i/100;
    if (this.i<100) this.fadeTimer= setTimeout(this.obj+'.fadeIt()', 40);
    else this.i= 0;
    };
    // Init function...
    var isLoaded= false;
    function popupInit(){
    //Fixing the browsercheck for opera... this can be removed if the browsercheck has been updated!!
    bw.opera5 = (navigator.userAgent.indexOf("Opera")>-1 && document.getElementById)?true:false
    if (bw.opera5) bw.ns6 = 0

    //Extending the browsercheck to add windows platform detection.
    bw.win= (navigator.userAgent.indexOf('Windows')>-1)
    tooltip= new makeTooltip('divTooltip');
    tooltip.elm.onmouseover= function(){ clearTimeout(tooltip.popTimer); if(bw.ns4){setTimeout('clearTimeout(tooltip.popTim er)',20)}; };
    tooltip.elm.onmouseout= dopopOut;
    if (bw.ns4) document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove= getMousemove;
    measureScreen();
    if (!bw.ns4) onresize= measureScreen;
    if (!bw.ns4) tooltip.elm.className= 'normalStyle';
    if (bw.ie && bw.win && !bw.ie4) tooltip.css.filter= 'alpha(opacity=100)'; //Preloads the windows filters.
    isLoaded= true;
    };
    // Initiates page on pageload if the browser is ok.
    if(bw.bw && !isLoaded) onload= popupInit;
    __________________________________________________ ___________________
    se vai qui vedi i tooltip andando col mouse sugli indirizzi


    http://www.marinelladalsasso.it/link/link.html

    spero ti sia utile, Ciao!

  4. #4
    Utente di HTML.it L'avatar di allejo
    Registrato dal
    Jul 2001
    Messaggi
    747
    Grazie mille x la risposta!!!!!!
    Allejo

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 © 2024 vBulletin Solutions, Inc. All rights reserved.