Avatar billede jhjorsal Mester
08. april 2003 - 00:35 Der er 3 kommentarer og
1 løsning

popup billed

Jeg har brug for noget kode som efter et klik på et lille billed kan anbringe en forstørrelse af et billed et eller andet sted på skærmen og har fundet noget kode der skulle gøre det, problemet er bare at jeg ikke fatter en døjt af hvad der foregår er der nogen der kan forklare mig hvad det går ud på, eller bedre endnu komme med et mere simpel eksempel.
Her er den kode jeg har fundet:

<html>

    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
        <meta name="GENERATOR" content="Microsoft FrontPage 4.0">
        <meta name="ProgId" content="FrontPage.Editor.Document">
        <title>mejet&aelig;rsker</title>
        <style type="text/css">
body  { background: url(gif/logoxl.gif) no-repeat fixed 50% 70% }
#foto1    { background-image: url(foto1.jpg); position: absolute; top: 187px; left: 50px; width: 601px; height: 448px; visibility: hidden }
#foto2  { background-image: url(foto2.jpg); position: absolute; top: 129px; left: 0px; width: 599px; height: 447px; visibility: hidden }
#foto3  { background-image: url(foto3.jpg); position: absolute; top: 182px; left: 58px; width: 598px; height: 448px; visibility: hidden }
#foto4 { background-image: url(foto4.jpg); position: absolute; top: 162px; left: 58px; width: 598px; height: 446px; visibility: hidden }
#foto5 { background-image: url(foto5.jpg); position: absolute; top: 137px; left: 76px; width: 599px; height: 447px; visibility: hidden }
#foto11    { background-image: url(foto1-1.jpg); position: absolute; top: 164px; left: 116px; width: 638px; height: 477px; visibility: hidden }
#foto21  { background-image: url(foto2-1.jpg); position: absolute; top: 250px; left: -10px; width: 638px; height: 477px; visibility: hidden }
#foto31 { background-image: url(foto3-1.jpg); position: absolute; top: 43px; left: 16px; width: 637px; height: 477px; visibility: hidden }
#foto12 { background-image: url(foto1-2.jpg); position: absolute; top: 181px; left: 16px; width: 631px; height: 293px; visibility: hidden }
#foto22 { background-image: url(foto2-2.jpg); position: absolute; top: 187px; left: 16px; width: 589px; height: 380px; visibility: hidden }
</style>
        <csactions>
            <csaction name="24CBB71" class="ShowHide" type="onevent" val0="foto1" val1="1">
            <csaction name="2612F12" class="ShowHide" type="onevent" val0="foto1" val1="0">
            <csaction name="29A2413" class="ShowHide" type="onevent" val0="foto2" val1="1">
            <csaction name="2A46DD4" class="ShowHide" type="onevent" val0="foto2" val1="0">
            <csaction name="2E69C55" class="ShowHide" type="onevent" val0="foto3" val1="1">
            <csaction name="2F6CA96" class="ShowHide" type="onevent" val0="foto3" val1="0">
            <csaction name="30951A7" class="ShowHide" type="onevent" val0="foto4" val1="1">
            <csaction name="30E1628" class="ShowHide" type="onevent" val0="foto4" val1="0">
            <csaction name="3403E79" class="ShowHide" type="onevent" val0="foto5" val1="1">
            <csaction name="34332910" class="ShowHide" type="onevent" val0="foto5" val1="0">
            <csaction name="C5CB7721" class="ShowHide" type="onevent" val0="foto11" val1="1">
            <csaction name="6ACD5812" class="ShowHide" type="onevent" val0="foto11" val1="0">
            <csaction name="77D99E13" class="ShowHide" type="onevent" val0="foto21" val1="1">
            <csaction name="78DE1214" class="ShowHide" type="onevent" val0="foto21" val1="0">
            <csaction name="7C4D6B15" class="ShowHide" type="onevent" val0="foto31" val1="1">
            <csaction name="7C85DE16" class="ShowHide" type="onevent" val0="foto31" val1="0">
            <csaction name="81955317" class="ShowHide" type="onevent" val0="foto12" val1="1">
            <csaction name="81D6B118" class="ShowHide" type="onevent" val0="foto12" val1="0">
            <csaction name="82F6A519" class="ShowHide" type="onevent" val0="foto22" val1="1">
            <csaction name="841F9820" class="ShowHide" type="onevent" val0="foto22" val1="0">
        </csactions>
        <csscriptdict>
            <script><!--
function CSClickReturn () {
    var bAgent = window.navigator.userAgent;
    var bAppName = window.navigator.appName;
    if ((bAppName.indexOf("Explorer") >= 0) && (bAgent.indexOf("Mozilla/3") >= 0) && (bAgent.indexOf("Mac") >= 0))
        return true; // dont follow link
    else return false; // dont follow link
}










CSStopExecution = false;
function CSAction(array) {
    return CSAction2(CSAct, array);
}
function CSAction2(fct, array) {
    var result;
    for (var i=0;i<array.length;i++) {
        if(CSStopExecution) return false;
        var actArray = fct[array[i]];
        if(actArray == null) return false;
        var tempArray = new Array;
        for(var j=1;j<actArray.length;j++) {
            if((actArray[j] != null) && (typeof(actArray[j]) == "object") && (actArray[j].length == 2)) {
                if(actArray[j][0] == "VAR") {
                    tempArray[j] = CSStateArray[actArray[j][1]];
                }
                else {
                    if(actArray[j][0] == "ACT") {
                        tempArray[j] = CSAction(new Array(new String(actArray[j][1])));
                    }
                else
                    tempArray[j] = actArray[j];
                }
            }
            else
                tempArray[j] = actArray[j];
        }           
        result = actArray[0](tempArray);
    }
    return result;
}
CSAct = new Object;

CSAg = window.navigator.userAgent; CSBVers = parseInt(CSAg.charAt(CSAg.indexOf("/")+1),10);
function IsIE() { return CSAg.indexOf("MSIE") > 0;}
function CSIEStyl(s) { return document.all.tags("div")[s].style; }
function CSNSStyl(s) { return CSFindElement(s,0); }
function CSFindElement(n,ly) { if (CSBVers < 4) return document[n];
    var curDoc = ly ? ly.document : document; var elem = curDoc[n];
    if (!elem) { for (var i=0;i<curDoc.layers.length;i++) {
        elem = CSFindElement(n,curDoc.layers[i]); if (elem) return elem; }}
    return elem;
}

function CSSetStyleVis(s,v) { if (IsIE()) CSIEStyl(s).visibility = (v == 0) ? "hidden" : "visible";
    else CSNSStyl(s).visibility = (v == 0) ? 'hide' : 'show'; }
function CSGetStyleVis(s) { if (IsIE()) return (CSIEStyl(s).visibility == "hidden") ? 0 : 1;
    else return (CSNSStyl(s).visibility == 'hide') ? 0 : 1;}

function CSShowHide(action) {
    if (action[1] == '') return;
    var type=action[2];
    if(type==0) CSSetStyleVis(action[1],0);
    else if(type==1) CSSetStyleVis(action[1],1);
    else if(type==2) {
        if (CSGetStyleVis(action[1]) == 0) CSSetStyleVis(action[1],1);
        else CSSetStyleVis(action[1],0);
    }
}

// --></script>
        </csscriptdict>
        <csactiondict>
            <script><!--
CSAct[/*CMP*/ '24CBB71'] = new Array(CSShowHide,/*CMP*/ 'foto1',1);
CSAct[/*CMP*/ '2612F12'] = new Array(CSShowHide,/*CMP*/ 'foto1',0);
CSAct[/*CMP*/ '29A2413'] = new Array(CSShowHide,/*CMP*/ 'foto2',1);
CSAct[/*CMP*/ '2A46DD4'] = new Array(CSShowHide,/*CMP*/ 'foto2',0);
CSAct[/*CMP*/ '2E69C55'] = new Array(CSShowHide,/*CMP*/ 'foto3',1);
CSAct[/*CMP*/ '2F6CA96'] = new Array(CSShowHide,/*CMP*/ 'foto3',0);
CSAct[/*CMP*/ '30951A7'] = new Array(CSShowHide,/*CMP*/ 'foto4',1);
CSAct[/*CMP*/ '30E1628'] = new Array(CSShowHide,/*CMP*/ 'foto4',0);
CSAct[/*CMP*/ '3403E79'] = new Array(CSShowHide,/*CMP*/ 'foto5',1);
CSAct[/*CMP*/ '34332910'] = new Array(CSShowHide,/*CMP*/ 'foto5',0);
CSAct[/*CMP*/ 'C5CB7721'] = new Array(CSShowHide,/*CMP*/ 'foto11',1);
CSAct[/*CMP*/ '6ACD5812'] = new Array(CSShowHide,/*CMP*/ 'foto11',0);
CSAct[/*CMP*/ '77D99E13'] = new Array(CSShowHide,/*CMP*/ 'foto21',1);
CSAct[/*CMP*/ '78DE1214'] = new Array(CSShowHide,/*CMP*/ 'foto21',0);
CSAct[/*CMP*/ '7C4D6B15'] = new Array(CSShowHide,/*CMP*/ 'foto31',1);
CSAct[/*CMP*/ '7C85DE16'] = new Array(CSShowHide,/*CMP*/ 'foto31',0);
CSAct[/*CMP*/ '81955317'] = new Array(CSShowHide,/*CMP*/ 'foto12',1);
CSAct[/*CMP*/ '81D6B118'] = new Array(CSShowHide,/*CMP*/ 'foto12',0);
CSAct[/*CMP*/ '82F6A519'] = new Array(CSShowHide,/*CMP*/ 'foto22',1);
CSAct[/*CMP*/ '841F9820'] = new Array(CSShowHide,/*CMP*/ 'foto22',0);

// --></script>
        </csactiondict>
    </head>

    <body>
        <p align="center"></p>
        <p align="center"><font size="5" face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><b>Mejet&aelig;rsker</b></font></p>
        <p align="center"></p>
        <basefont face="Arial" black>
        <div align="CENTER">
            <table border="1" cellpadding="0" cellspacing="0" width="847" background="logoxl1.gif">
                <tr bgcolor="ffff00" height="30">
                    <td width="65" align="center" height="30">0</td>
                    <td width="111" height="30">
                        <div align="CENTER">
                            Navn</div>
                    </td>
                    <td width="140" height="30">
                        <div align="CENTER">
                            Model</div>
                    </td>
                    <td width="36" height="30">
                        <div align="CENTER">
                            Fod</div>
                    </td>
                    <td width="49" align="center" height="30">
                        <div align="CENTER">
                            Timer</div>
                    </td>
                    <td width="55" height="30">
                        <div align="CENTER">
                            &Aring;rgang</div>
                    </td>
                    <td width="55" height="30">
                        <div align="CENTER">
                            Pris</div>
                    </td>
                    <td width="280" height="30">
                        <div align="CENTER">
                            <font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular" size="2">klick p&aring; billederne for forst&oslash;rrelsen</font></div>
                    </td>
                </tr>
                <tr height="60">
                    <td width="65" background="yellow.gif" align="center" height="60">
                        <p align="center">&nbsp;</p>
                    </td>
                    <td width="111" background="yellow.gif" height="60">
                        <div align="center">
                            <font size="3">New Holland</font></div>
                    </td>
                    <td width="140" background="yellow.gif" height="60">NH TF 78&nbsp;</td>
                    <td width="36" background="yellow.gif" align="center" height="60">20</td>
                    <td width="49" background="yellow.gif" align="right" height="60">1062</td>
                    <td width="55" background="yellow.gif" align="center" height="60">1998</td>
                    <td background="yellow.gif" align="right" width="55" height="60">
                        <div align="center">
                            forh&oslash;r</div>
                    </td>
                    <td width="280" background="yellow.gif" bgcolor="black" height="60">
                        <div align="center">
                            &nbsp;</div>
                    </td>
                </tr>
                <tr height="60">
                    <td width="65" align="center" height="60">
                        <p align="center">solgt</p>
                    </td>
                    <td width="111" height="60">
                        <div align="center">
                            New Holland</div>
                    </td>
                    <td width="140" height="60">NH TX 68 FSH plus</td>
                    <td width="36" align="center" height="60">20</td>
                    <td width="49" align="right" height="60">1462</td>
                    <td width="55" align="center" height="60">1998</td>
                    <td align="right" width="55" height="60">
                        <div align="center">
                            forh&oslash;r</div>
                    </td>
                    <td width="280" bgcolor="black" height="60">
                        <div align="center"><p>
                       
                            <a href="#"
                            onclick="CSAction(new Array(/*CMP*/'24CBB71'));return CSClickReturn();"
                            csclick="24CBB71"
                            onmouseout="CSAction(new Array(/*CMP*/'2612F12'));"
                            csout="2612F12">
                            <img src="foto1.jpg" width="50" height="40" border="0">
                            </a>
                           
                            <a href="#"
                            onclick="CSAction(new Array(/*CMP*/'29A2413'));return CSClickReturn();"
                            csclick="29A2413"
                            onmouseout="CSAction(new Array(/*CMP*/'2A46DD4'));"
                            csout="2A46DD4">
                            <img src="foto2.jpg" width="50" height="40" border="0">
                            </a>
                           
                            <a href="#"
                            onclick="CSAction(new Array(/*CMP*/'2E69C55'));return CSClickReturn();"
                            csclick="2E69C55"
                            onmouseout="CSAction(new Array(/*CMP*/'2F6CA96'));"
                            csout="2F6CA96">
                            <img src="foto3.jpg" width="50" height="40" border="0">
                            </a>
                           
                            <a href="#"
                            onclick="CSAction(new Array(/*CMP*/'30951A7'));return CSClickReturn();"
                            csclick="30951A7"
                            onmouseout="CSAction(new Array(/*CMP*/'30E1628'));"
                            csout="30E1628">
                            <img src="foto4.jpg" width="50" height="40" border="0">
                            </a>
                           
                        <a href="#"
                        onclick="CSAction(new Array(/*CMP*/'3403E79'));return CSClickReturn();"
                        csclick="3403E79"
                        onmouseout="CSAction(new Array(/*CMP*/'34332910'));"
                        csout="34332910">
                        <img src="foto5.jpg" width="50" height="40" border="0">
                        </a>
                       
                      </p>
                        </div>
                    </td>
                </tr>
                <tr height="60">
                    <td width="65" background="yellow.gif" align="center" height="60">ny</td>
                    <td width="111" background="yellow.gif" height="60">
                        <div align="center">
                            New Holland</div>
                    </td>
                    <td width="140" background="yellow.gif" height="60">NH TX 68 SLH</td>
                    <td width="36" background="yellow.gif" align="center" height="60">20</td>
                    <td width="49" background="yellow.gif" align="right" height="60">650</td>
                    <td width="55" background="yellow.gif" align="center" height="60">1998</td>
                    <td background="yellow.gif" align="right" width="55" height="60">740,000</td>
                    <td width="280" background="yellow.gif" bgcolor="black" height="60">
                        <div align="center">
                            <a href="#" onclick="CSAction(new Array(/*CMP*/'C5CB7721'));return CSClickReturn();" csclick="C5CB7721" onmouseout="CSAction(new Array(/*CMP*/'6ACD5812'));" csout="6ACD5812"><img src="foto1-1.jpg" width="50" height="40" border="0"></a> <a href="#" onclick="CSAction(new Array(/*CMP*/'77D99E13'));return CSClickReturn();" csclick="77D99E13" onmouseout="CSAction(new Array(/*CMP*/'78DE1214'));" csout="78DE1214"><img src="foto2-1.jpg" width="50" height="40" border="0"></a> <a href="#" onclick="CSAction(new Array(/*CMP*/'7C4D6B15'));return CSClickReturn();" csclick="7C4D6B15" onmouseout="CSAction(new Array(/*CMP*/'7C85DE16'));" csout="7C85DE16"><img src="foto3-1.jpg" width="50" height="40" border="0"></a></div>
                    </td>
                </tr>
                <tr height="60">
                    <td width="65" align="center" height="60">solgt</td>
                    <td width="111" height="60">
                        <div align="center">
                            New Holland</div>
                    </td>
                    <td width="140" height="60">NH TX 68 SLH</td>
                    <td width="36" align="center" height="60">20</td>
                    <td width="49" align="right" height="60">1550</td>
                    <td width="55" align="center" height="60">1996</td>
                    <td width="55" align="right" height="60">550,000</td>
                    <td width="280" bgcolor="black" height="60"></td>
                </tr>
                <tr height="60">
                    <td width="65" background="yellow.gif" align="center" height="60"></td>
                    <td width="111" background="yellow.gif" height="60">
                        <div align="center">
                            New Holland</div>
                    </td>
                    <td width="140" background="yellow.gif" height="60">NH TX 66 SLH</td>
                    <td width="36" background="yellow.gif" align="center" height="60">20</td>
                    <td width="49" background="yellow.gif" align="right" height="60">396</td>
                    <td width="55" background="yellow.gif" align="center" height="60">1998</td>
                    <td width="55" background="yellow.gif" align="right" height="60">700,000</td>
                    <td width="280" background="yellow.gif" bgcolor="black" height="60">&nbsp;</td>
                </tr>
                <tr height="60">
                    <td width="65" align="center" height="60">
                        <p align="center">&nbsp;</p>
                    </td>
                    <td width="111" height="60">
                        <div align="center">
                            New Holland</div>
                    </td>
                    <td width="140" height="60">NH TX 36 SLH</td>
                    <td width="36" align="center" height="60">20</td>
                    <td width="49" align="right" height="60">2000</td>
                    <td width="55" align="center" height="60">1989</td>
                    <td align="right" width="55" height="60">340,000</td>
                    <td width="280" bgcolor="black" height="60">&nbsp;</td>
                </tr>
                <tr height="60">
                    <td width="65" align="center" background="yellow.gif" height="60">&nbsp;solgt</td>
                    <td width="111" background="yellow.gif" height="60">
                        <div align="center">
                            New Holland</div>
                    </td>
                    <td width="140" background="yellow.gif" height="60">NH TX 34 SLH</td>
                    <td width="36" align="center" background="yellow.gif" height="60">17</td>
                    <td width="49" align="right" background="yellow.gif" height="60">1800</td>
                    <td width="55" align="center" background="yellow.gif" height="60">1989</td>
                    <td align="right" width="55" background="yellow.gif" height="60">330,000</td>
                    <td width="280" bgcolor="black" height="60">
                        <p align="center"><a href="#" onclick="CSAction(new Array(/*CMP*/'81955317'));return CSClickReturn();" csclick="81955317" onmouseout="CSAction(new Array(/*CMP*/'81D6B118'));" csout="81D6B118"><img src="foto1-2.jpg" width="50" height="40" border="0"></a> <a href="#" onclick="CSAction(new Array(/*CMP*/'82F6A519'));return CSClickReturn();" csclick="82F6A519" onmouseout="CSAction(new Array(/*CMP*/'841F9820'));" csout="841F9820"><img src="foto2-2.jpg" width="50" height="40" border="0"></a></p>
                    </td>
                </tr>
                <tr>
                    <td colspan="8" bgcolor="ffff00">
                        <p align="center">Designforslag fra Nico - oprettet d.12 december 2001</p>
                    </td>
                </tr>
            </table>
        </div>
        <p align="center"><font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular">&nbsp;</font></p>
        <font face="Arial,Helvetica,Geneva,Swiss,SunSans-Regular"><!--<Marquee>2 stk NEW HOLLAND TX 68 på vej - ring og hør nærmere</Marquee>-->
            <div id="foto21"></div>
            <div id="foto22"></div>
            <div id="foto31"></div>
            <div id="foto12"></div>
            <div id="foto11"></div>
        </font>
        <div id="foto1"></div>
        <div id="foto2"></div>
        <div id="foto3"></div>
        <div id="foto4"></div>
        <div id="foto5"></div>
    </body>

</html>

med venlig hilsen
Johnny
Avatar billede Slettet bruger
08. april 2003 - 17:54 #1
Avatar billede jhjorsal Mester
10. april 2003 - 11:01 #2
Hej phoenixv
Det fatter jeg heller ikke men det virker som det skal, jeg kunne dog ikke bruge det alligevel da jeg har mit phpscript placeret i et frameset og jeg havde håbet at popup vinduet kunne komme ud over de fysiske grænser for det frame og lappe ind over nogle af de andre frames men det vil det ikke, det er jo dog ikke din skyld og du gav et svar og fortjener dine point så post et svar så får du dem.
mvh
johnny
Avatar billede Slettet bruger
10. april 2003 - 13:30 #3
Hm, hvis det store billede skal gå over frames, skal du enten ud i noget meget kompliceret JavaScript eller bruge normale popup-vinduer.
Avatar billede jhjorsal Mester
10. april 2003 - 13:41 #4
Det har du fuldstændig ret i og jeg valgte normal popup vinduer
mvh
Johnny
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Vi tilbyder markedets bedste kurser inden for webudvikling

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester