ERLEDIGT
NEIN
NEIN
ANTWORTEN
1
1
ZUGRIFFE
241
241
EMPFEHLEN
-
29.10.08 21:17 #1
- Registriert seit
- Mar 2006
- Beiträge
- 93
Hi Ihr Lieben,
ich habe in einem Frame eine Navigation mit Rollovers - überholt, aber ich soll die alte Seite eines Freundes aufpeppen.
A-Button = Normalzustand
B-Button = bei Mouseover
Wenn ich auf einen A-Button klicke und die entsprechende Seite geht auf, soll aber der B-Button aktiv bleiben, solange ich auf der Seite bin.
Hier ist der Code, wie ihn mein Golive 5.0 erzeugt. Was muss ich tun?
Inzwischen habe ich Dreamweaver, weil Golive nicht mehr unterstützt wird. Habe mit dem Programm nicht viel gemacht. Geht so etwas damit besser?
HTML-Code:<html> <head> <csscriptdict> <script><!-- CSInit = new Array; function CSScriptInit() { if(typeof(skipPage) != "undefined") { if(skipPage) return; } idxArray = new Array; for(var i=0;i<CSInit.length;i++) idxArray[i] = i; CSAction2(CSInit, idxArray);} 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 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 } function CSButtonReturn () { 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 false; // follow link else return true; // follow link } CSIm = new Object(); function CSIShow(n,i) { if (document.images) { if (CSIm[n]) { var img = (!IsIE()) ? CSFindElement(n,0) : document[n]; if (img && typeof(CSIm[n][i].src) != "undefined") {img.src = CSIm[n][i].src;} if(i != 0) self.status = CSIm[n][3]; else self.status = " "; return true; } } return false; } function CSILoad(action) { im = action[1]; if (document.images) { CSIm[im] = new Object(); for (var i=2;i<5;i++) { if (action[i] != '') { CSIm[im][i-2] = new Image(); CSIm[im][i-2].src = action[i]; } else CSIm[im][i-2] = 0; } CSIm[im][3] = action[5]; } } 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; // --></script> </csscriptdict> <csactiondict> <script><!-- CSInit[CSInit.length] = new Array(CSILoad,/*CMP*/'button',/*URL*/'homeA.gif',/*URL*/'homeB.gif',/*URL*/'',''); // --></script> </csactiondict> </head> <body bgcolor="#ffffff" onload="CSScriptInit();"> <p><csobj w="200" h="40" t="Button" ht="homeB.gif"><a href="#" onmouseover="return CSIShow(/*CMP*/'button',1)" onmouseout="return CSIShow(/*CMP*/'button',0)" onclick="return CSButtonReturn()"><img src="homeA.gif" width="200" height="40" name="button" border="0"></a></csobj></p> </body> </html>
Geändert von exhubiranta (29.10.08 um 21:21 Uhr)
-
Hi,
ohne mich durch deinen Code quälen zu wollen. Um eine Schaltfläche mit drei Zuständen (passiv, aktiv, over) zu erstellen, könntest du drei Klassen erstellen. Diese formatieren den Button für den jeweiligen Zustand. Über die Eventhandler onmouseover, onmouseout und onclick werden die benötigten Klassennamen zugewiesen.
Beispiel:
Vielleicht hilft dir das weiter.Code :1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
<html> <head> <title>www.tutorials.de</title> <meta name="author" content="Quaese"> <meta http-equiv="content-type" content="text/html; charset=iso-8859-1"> <script type="text/javascript"> <!-- var objOld = null; function checkMe(objThis){ if(objThis != objOld){ objThis.className = "aktiv"; if(objOld != null) objOld.className = "passiv"; objOld = objThis; } } function overMe(objThis){ objThis.oldClass = objThis.className; objThis.className = "over"; } function outMe(objThis){ objThis.className = (objThis != objOld) ? objThis.oldClass : "aktiv"; } //--> </script> <style type="text/css"> <!-- .passiv{} .aktiv{ background: #f00;} .over{ background: #0f0;} //--> </style> </head> <body> <ul> <li id="li_01" class="passiv" onclick="checkMe(this);" onmouseover="overMe(this);" onmouseout="outMe(this);">Eins</li> <li id="li_02" class="passiv" onclick="checkMe(this);" onmouseover="overMe(this);" onmouseout="outMe(this);">Zwei</li> <li id="li_03" class="passiv" onclick="checkMe(this);" onmouseover="overMe(this);" onmouseout="outMe(this);">Drei</li> </ul> </body> </html>
Ciao
QuaeseVielleicht muss man manchmal vom Weg abkommen, um nicht auf der Strecke zu bleiben!
----
Der "Fortsetzungsroman" auf www.leuteforum.de
New kind to realize large scalable projects with jQuery: jQuery SDK
Ähnliche Themen
-
Rollover für Site-Navigation
Von Mardel im Forum PhotoshopAntworten: 1Letzter Beitrag: 11.06.07, 08:43 -
RollOver-Navigation
Von valkuere im Forum Javascript & AjaxAntworten: 0Letzter Beitrag: 30.07.06, 11:10 -
Rollover Navigation...
Von thespecialx im Forum CSSAntworten: 1Letzter Beitrag: 27.12.05, 09:29 -
CSS Rollover Navigation
Von Bicko im Forum CSSAntworten: 5Letzter Beitrag: 24.02.05, 13:23 -
CSS Rollover Navigation - Wie?
Von sunshineworld im Forum CSSAntworten: 2Letzter Beitrag: 26.06.02, 11:41





Zitieren

Login





