Register for your free account! | Forgot your password?

Go Back   elitepvpers > Coders Den > Web Development
You last visited: Today at 14:54

  • Please register to post and access all features, it's quick, easy and FREE!

Advertisement



jQuery Problem / Frage

Discussion on jQuery Problem / Frage within the Web Development forum part of the Coders Den category.

Reply
 
Old   #1
 
CracyCrazz's Avatar
 
elite*gold: 8
Join Date: Jul 2010
Posts: 1,085
Received Thanks: 126
jQuery Problem / Frage

Moin Leute,

ich versuche jetzt schon einige Stunden die Lösung meines Problems zu finden, leider finde ich es einfach nicht. Das Problem ist, ich hatte vor eine Funktion zu erstellen um nach oben Sliden zu können, also ein Button der erst Versteckt ist und nach einer gewissen nach unten gescrollten Pixeln wird es angezeigt. So die Funktion das es nach oben Scrollt ist kein Problem diese funktioniert ohne Probleme, aber die Funktion mit dem Verstecken und des Anzeigen ist das Problem.

So, jetzt kommen wir mal zum Code teil:

PHP Code:
        <script>
            $(
document).ready(function() {
                $(
window).scroll(function() {
                    if($(
this).scrollTop() > 200) {
                        $(
'#back-to-top').fadeIn();
                    } else {
                        $(
'#back-to-top').fadeOut();
                    }
                });
                
                $(
'#back-to-top').click(function() {
                    $(
'html').animate({
                        
scrollTop0
                    
}, 800);
                    return 
false;
                });
            });
        
</script> 
Der untere Teil funktioniert einwandfrei, nur die Funktion ist derzeit das Problem.

Ich hoffe ihr klnnt mir weiterhelfen, achja bitte nicht mit Google doch mal. Das versuche ich seit Gestern aber finde einfach nichts..

Wenn ihr noch Informationen braucht fragt einfach.
CracyCrazz is offline  
Old 01/08/2012, 20:14   #2

 
Ennea's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 3,670
Received Thanks: 999
Du benutzt da $(this).scrollTop(). Gibt die Funktion, angewandt auf window, überhaupt irgendwas anständiges zurück? Vielleicht solltest du eher $("html").scrollTop() benutzen.
Ennea is offline  
Old 01/08/2012, 20:14   #3


 
Whoknowsit's Avatar
 
elite*gold: 146
Join Date: May 2009
Posts: 3,764
Received Thanks: 6,974
Also bei mir gehts problemlos. Wäre natürlich denkbar, dass ich das Problem nicht verstehe

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta http-equiv="Content-Language" content="de"/>
<meta http-equiv="Content-Script-Type" content="text/javascript"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<style type="text/css">
    body {
        margin:0px;
    }

    #back-to-top {
        background-color: red;
        position:fixed;
        bottom:0;
        width:100%;
        z-index:100;
        display: none;
    }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script> 
            $(document).ready(function() { 
                $(window).scroll(function() { 
                    if($(this).scrollTop() > 200) { 
                        $('#back-to-top').fadeIn(); 
                    } else { 
                        $('#back-to-top').fadeOut(); 
                    } 
                }); 
                $('#back-to-top').click(function() { 
                    $('html').animate({ 
                        scrollTop: 0 
                    }, 800); 
                    return false; 
                }); 
            }); 
        </script>
</head>
<body>
<div id="back-to-top">
    Hallo Welt!
</div>

    <?php
    
for($i 1$i 100$i++) {
      echo 
"{$i}<br />";
    }
    
?>

</body>
</html>
Whoknowsit is offline  
Old 01/09/2012, 13:49   #4
 
CracyCrazz's Avatar
 
elite*gold: 8
Join Date: Jul 2010
Posts: 1,085
Received Thanks: 126
Quote:
Originally Posted by Whoknowsit View Post
Also bei mir gehts problemlos. Wäre natürlich denkbar, dass ich das Problem nicht verstehe

PHP Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"/>
<meta http-equiv="Content-Language" content="de"/>
<meta http-equiv="Content-Script-Type" content="text/javascript"/>
<meta http-equiv="Content-Style-Type" content="text/css"/>
<meta http-equiv="Pragma" content="no-cache"/>
<meta http-equiv="Expires" content="-1"/>
<meta http-equiv="Cache-Control" content="no-cache"/>
<style type="text/css">
    body {
        margin:0px;
    }

    #back-to-top {
        background-color: red;
        position:fixed;
        bottom:0;
        width:100%;
        z-index:100;
        display: none;
    }
</style>
<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1/jquery.min.js"></script>
<script> 
            $(document).ready(function() { 
                $(window).scroll(function() { 
                    if($(this).scrollTop() > 200) { 
                        $('#back-to-top').fadeIn(); 
                    } else { 
                        $('#back-to-top').fadeOut(); 
                    } 
                }); 
                $('#back-to-top').click(function() { 
                    $('html').animate({ 
                        scrollTop: 0 
                    }, 800); 
                    return false; 
                }); 
            }); 
        </script>
</head>
<body>
<div id="back-to-top">
    Hallo Welt!
</div>

    <?php
    
for($i 1$i 100$i++) {
      echo 
"{$i}<br />";
    }
    
?>

</body>
</html>
Bei mir funktioniert es seltsamer weise mit deinem Code bei mir auch nicht, ausser wenn ich es komplett Copy & Paste in eine neue PHP Datei. Aber in meinem Skript funktioniert es seltsamer weise nicht. Ich bin etwas verwundert.. Wenn ich das Display nicht auf none setze funktioniert das Hochscrollen ja ohne Probleme. Nur das FadeIn und FadeOut ist komisch :x.
CracyCrazz is offline  
Old 01/09/2012, 14:12   #5

 
Ennea's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 3,670
Received Thanks: 999
Quote:
Originally Posted by CracyCrazz View Post
Bei mir funktioniert es seltsamer weise mit deinem Code bei mir auch nicht, ausser wenn ich es komplett Copy & Paste in eine neue PHP Datei.
Encoding deiner Datei futsch? Schau mal nach.
Ennea is offline  
Old 01/09/2012, 19:35   #6
 
CracyCrazz's Avatar
 
elite*gold: 8
Join Date: Jul 2010
Posts: 1,085
Received Thanks: 126
Eigentlich nicht, moment ich Poste mal den Kompletten Quellcode da ist aber eigentlich nichts falsch.
CracyCrazz is offline  
Old 01/09/2012, 19:53   #7

 
Ennea's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 3,670
Received Thanks: 999
Gehste mal oben bei Notepad++ auf "Encoding" und schaust worauf das steht. Üblicherweise ANSI. Aber da du sagtest, dass der andere Code geht, wenn du ihn in eine neue Datei einfügst, ging ich davon aus, dass das eventuell falsch gesetzt ist.
Ennea is offline  
Old 01/09/2012, 21:08   #8
 
CracyCrazz's Avatar
 
elite*gold: 8
Join Date: Jul 2010
Posts: 1,085
Received Thanks: 126
Es ist beides Ansi Kodiert, gibt es sonst noch etwas woran es liegen könnte?
CracyCrazz is offline  
Old 01/09/2012, 21:15   #9

 
Ennea's Avatar
 
elite*gold: 0
Join Date: May 2006
Posts: 3,670
Received Thanks: 999
Jetzt, wo du's sagst.. ja! Du hast ready() für document zwei mal definiert Sollte man nicht tun.
Ennea is offline  
Reply


Similar Threads Similar Threads
JQuery -JSON
11/28/2011 - General Coding - 0 Replies
Hey, mein Freund hat ein Problem und ich wollte mal wissen, ob ihr da helfen könnt? Die Fragestellung ist sehr kurz und ich persönlich kann damit nichts anfangen , aber hier die Frage: Wie krieg ich beim Fullcalendar in JQuery nen Datensatz per JSON rein?
[JQuery, VB.net, Autoit] Der Iphone Slider
09/01/2011 - Coding Releases - 7 Replies
Joah nach n paar Tagen "basteln" präsentiere ich euch mal wieder nen neuen Release: Der Iphone Slider umgesetzt in 3 Sprachen für mehr Kompatibilität! Uhm jop... Viel erklären kann ich nicht aber ein paar Worte dazu: Die VB.net Version läuft am stabilsten, der Slide-Sub kommt Ursprünglich von TheHackerZero, jedoch ist das ding nichmehr zurückgeslidet und der Sound hat genervt, also hab ich den Ton rausgeschmissen und ne Slide-Back Sub dazugeschrieben, also gibts auch bissel Credits an...
Jquery Ajax PHP HTML Java PLEASE HELP ME!
05/04/2011 - Main - 0 Replies
Hallo Com, http://ralphwhitbeck.com/content/binary/JQuery_lo go_color_onwhite.png Ich suche jemanden der mich in skype adden kann und mir hilft, ich habe ein javascript (das ich hier nicht veröffentliche) und möchte da ein PHP script einbauen. Aber es geht nicht so wie ich es will bitte helf mir jemand persöhnlich skype ist am besten
Jquery/Ajax [FRAGE]
02/07/2011 - Metin2 Private Server - 23 Replies
Ich wollte mal fragen... ich habe ne webseite und möchte im content bereich etwas anzeigen lassen ohne die seite neu laden zu müssen also es gibt zum beispiel



All times are GMT +1. The time now is 14:54.


Powered by vBulletin®
Copyright ©2000 - 2026, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply.

Support | Contact Us | FAQ | Advertising | Privacy Policy | Terms of Service | Abuse
Copyright ©2026 elitepvpers All Rights Reserved.