tutorials.de Buch-Aktion 05/2012
ERLEDIGT
NEIN
ANTWORTEN
1
ZUGRIFFE
314
EMPFEHLEN
  • An Twitter übertragen
  • An Facebook übertragen
AUF DIESES THEMA
ANTWORTEN
  1. #1
    parafi parafi ist offline Mitglied Silber
    Registriert seit
    Jan 2009
    Beiträge
    73
    Hi allerseits

    Ich habe eine ganz einfache Seite mit zwei div's (intro und stars)
    Nun wenn ich auf meiner Seite folgenden Code abspiele, zeigt mir der IE7 immer einen Fehler an. Weshalb? Muss der Code im Header stehen?

    Die Fehlermeldung gibt mir an, dass die Zeile mit dem $('intro').fade({ duration: 0.5 }); den Fehler wirft.
    Fehler: "null" ist Null oder kein Objekt

    Code :
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    
    document.observe( 'dom:loaded', function(){
       setTimeout('showFoo()',4000);
    });
     
    function showFoo(){
        $('intro').fade({ duration: 0.5 });
        $('stars').appear({ duration: 0.8 });
        setTimeout('showMe()',4000);
    }
     
    function showMe(){
        $('stars').fade({ duration: 0.5 });
    }

    HTML-Code:
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"><head><meta http-equiv="content-type" content="text/html; charset=UTF-8" /><meta name="robots" content="noodp,noydir" />
    	<script src="/js/common_swfobject_prototype_effects.js" type="text/javascript"></script>	  <script src="/data/swffit.js" type="text/javascript"></script>
    <script type="text/javascript">/* <![CDATA[ */document.observe("dom:loaded", function(){
    * *setTimeout('showImage()',4000);
    
    });
    
    
    function showImage(){
        alert($('intro'));
        $('intro').fade({ duration: 0.5 });
        $('stars').appear({ duration: 0.8 });	
        setTimeout('showCard()',4000);}
    
    function showCard(){	
       $('stars').fade({ duration: 0.5 });	
     }
    
    </script>
    
    <div id="intro" style="top:350px; position:absolute; width:400px;">
    <p class="footnote" style="color:#FFFFFF; font-size:16px; line-height:22px;">For every shooting star,<br />you can make a wish.<br />We wish you ...</p>
    </div>
    <div id="stars" style="position:absolute; top:200px; left:-200px; display:none;"></div>
    </body>
    </html>
    Grüsse
    parafi
    Geändert von parafi (21.12.11 um 13:13 Uhr)
     

  2. #2
    Avatar von para_noid
    para_noid para_noid ist offline Mitglied Gold
    Registriert seit
    Aug 2011
    Beiträge
    144
    Den Zugriff auf bestimmte Elemente via ID kenne ich nur mit #

    Code :
    1
    
    $('#intro').fade({ duration: 0.5 });

    statt

    Code :
    1
    
    $('intro').fade({ duration: 0.5 });

    Weiß aber nicht ob das was mit deinem Problem zu tun hat...
     
    Für die Übereinstimmung von Niederschrift und Hirninhalt.

Ähnliche Themen

  1. Problem mit fade in/out
    Von Ghorn im Forum Adobe Flex & AIR
    Antworten: 2
    Letzter Beitrag: 17.08.09, 17:27
  2. Prototype Window Class Problem
    Von Bogat im Forum Javascript & Ajax
    Antworten: 3
    Letzter Beitrag: 30.04.07, 10:27
  3. Text Fade in und Fade out mit Tweens funktioniert nicht
    Von fish-guts im Forum Flash Plattform
    Antworten: 4
    Letzter Beitrag: 22.02.07, 13:37
  4. Fade-In Problem bei Grafiken
    Von PingPages im Forum Flash Plattform
    Antworten: 3
    Letzter Beitrag: 29.05.05, 22:31
  5. AEE 6 PRO - Text mit Hintergrundbild (Fade-In / Fade-Out)
    Von kaji im Forum Videoschnitt, Videotechnik & -produktion
    Antworten: 1
    Letzter Beitrag: 24.04.04, 20:50