काम नहीं कर रहा: http://i333180.iris.fhict.nl/p2_vc/जावास्क्रिप्ट SmoothScroll फिर भी अपनी साइट पर काम कर रहे
ते पेज नीचे नेविगेट के लिए एक बटन है, कार्रवाई तत्काल है, लेकिन आसान स्क्रॉलिंग बहुत अच्छे है।
तो, मैं चारों ओर गूगल, बहुत कोशिश की और कम से कम स्क्रिप्ट मैंने पाया पर यह है: लेकिन मैं यह काम कर रहा प्राप्त नहीं कर सकते।
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
रेफरी: https://css-tricks.com/snippets/jquery/smooth-scrolling/
यह मैं कैसे
के बीच मेरे कोड को जोड़ा गया है<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script>
$(function() {
$('a[href*=#]:not([href=#])').click(function() {
if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
var target = $(this.hash);
target = target.length ? target : $('[name=' + this.hash.slice(1) +']');
if (target.length) {
$('html,body').animate({
scrollTop: target.offset().top
}, 1000);
return false;
}
}
});
});
</script>
</head>
बटन:
<body>
<a id='button_down' href='#section' onclick="document.getElementById('moodvideo').pause()"><img src='scroll.png' alt='Scroll'></a>
</body>
मैं उदाहरण साइट डायन दिया गया था का निरीक्षण किया और यह जोड़ा उसी तरह से मेरे एचटीएमएल के लिए। रेफरी लिंक का निरीक्षण: https://css-tricks.com/examples/SmoothPageScroll/ लेकिन मैं नहीं कर सकते यह काम कर रहा ..
यह भी सुनिश्चित, मैं एक अन्य स्क्रिप्ट, चुड़ैल, एक ही कार्रवाई की जरूरत है एक वीडियो के अंत के बाद की है। उस के लिए स्क्रिप्ट है:
<script>
function videoEnded() {
window.location.href="#section";
}
</script>
यह एक ही बात करने के लिए है; अच्छी तरह से स्क्रॉल करें।
मुझे उम्मीद थी कि मैंने समझ में समझाया है, अगर नहीं, तो मैं इसे फिर से कोशिश करना चाहता हूं। सादर
संपादित स्क्रिप्ट नहीं है ऑनलाइन साइट के लिए जोड़ा क्योंकि स्क्रिप्ट अभी तक काम कर नहीं है, अगर यह यह easer मैं इसे ऑनलाइन जोड़ सकते हैं होगा।
अद्यतन साइट <script>
का यह टुकड़ा बेहतर है काम नहीं कर रहा लिपियों