PSD-Tutorials.de
Forum für Design, Fotografie & Bildbearbeitung
Tutkit
Agentur
Hilfe
Kontakt
Start
Forum
Aktuelles
Besonderer Inhalt
Foren durchsuchen
Tutorials
News
Anmelden
Kostenlos registrieren
Aktuelles
Suche
Suche
Nur Titel durchsuchen
Von:
Menü
Anmelden
Kostenlos registrieren
App installieren
Installieren
JavaScript ist deaktiviert. Für eine bessere Darstellung aktiviere bitte JavaScript in deinem Browser, bevor du fortfährst.
Du verwendest einen veralteten Browser. Es ist möglich, dass diese oder andere Websites nicht korrekt angezeigt werden.
Du solltest ein Upgrade durchführen oder einen
alternativen Browser
verwenden.
Antworten auf deine Fragen:
Neues Thema erstellen
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
Crome ignoriert meine js Scroll Animation bei eingebundenen Objekten
Beitrag
<blockquote data-quote="Karol" data-source="post: 2234675" data-attributes="member: 537889"><p>Hi,</p><p>ich verzweifle an der Aufgabe Crome klar zumachen sich wie die anderen Browser zu verhalten. Ich habe auf der Website <a href="http://smz.de" target="_blank">www.smz.de </a>hauptsächlich die Gestaltung, HTML und CSS umgesetzt. Das Java Script wurde von einer ehemaligen Mitarbeiterin geschrieben zu der ich leider kein Kontakt mehr habe. Da ich im Java Script Bereich noch ein Neuling bin kriege ich das Problem ohne Hilfe nicht in den Griff. </p><p></p><p>Alle anderen Browser führen den Code richtig aus nur Crome lässt alle <li> stehen und bewegt das enthaltene <object>. </p><p></p><p>Ich wäre sehr dankbar wenn jemand eine Idee hätte dem engegenzuwirken oder findet jemand einen Fehler im Code?</p><p></p><p>[CODE]</p><p></p><p> // Scroll cases</p><p> var scrollAnimation,</p><p> fadeAnimation,</p><p> scrollSpeed = 0,</p><p> // higher number = slower scroll, must be > 0</p><p> scrollSpeedAdjust = 1.6,</p><p> listPosition;</p><p> </p><p> function scrollCases(visibleSectionCasesList, direction, e){</p><p> var listPosition = parseInt(visibleSectionCasesList.css('left'));</p><p> </p><p> // check if we leave maxwidth of the caseslist</p><p> if(direction == 'left' && listPosition <= 0){</p><p> scrollSpeed = scrollSpeedAdjust * (listPosition * -1 + (visibleSectionCasesList.width() / 10));</p><p> scrollAnimation = visibleSectionCasesList.animate({</p><p> left : 0</p><p> }, scrollSpeed);</p><p> } else if(direction == 'right' && (parseInt(visibleSectionCasesList.css('width')) * -1) + parseInt($('section').css('width')) <= listPosition){</p><p> scrollSpeed = scrollSpeedAdjust * (visibleSectionCasesList.width() + listPosition);</p><p> scrollAnimation = visibleSectionCasesList.animate({</p><p> left : (visibleSectionCasesList.width() * -1) + $(window).width()</p><p> </p><p> }, scrollSpeed);</p><p> } else {</p><p> // trigger mouseout to one of both links to stop scrolling right/left and check arrow visibility</p><p> $('.arrow-right').trigger('mouseout');</p><p> }</p><p> </p><p> }</p><p> </p><p> // start scrolling cases when mouseover the hidden links</p><p> $('.arrow-right, .arrow-left').on('mouseover', function(e){</p><p> if(typeof scrollAnimation != 'undefined') {</p><p> scrollAnimation.stop();</p><p> }</p><p> if(typeof fadeAnimation != 'undefined') {</p><p> fadeAnimation.stop();</p><p> }</p><p> </p><p> var visibleSection = $('section:eq(' + ($(window).scrollTop() / $(window).height())+ ')'),</p><p> visibleSectionCasesList = visibleSection.find('ul, object'),</p><p> direction = $(this).attr('data-direction');</p><p> </p><p> scrollCases(visibleSectionCasesList, direction, e);</p><p> </p><p> }).on('mouseout', function(){</p><p> var visibleSection = $('section:eq(' + ($(window).scrollTop() / $(window).height())+ ')'),</p><p> visibleSectionCasesList = visibleSection.find('ul, object'),</p><p> listPosition = parseInt(visibleSectionCasesList.css('left')),</p><p> direction = $(this).attr('data-direction');</p><p> </p><p> // stop scroll animation</p><p> scrollAnimation.stop();</p><p></p><p> if(direction == 'left' && (listPosition + 30) <= 0){</p><p> fadeAnimation = visibleSectionCasesList.animate({</p><p> left : listPosition + 30</p><p> }, 200);</p><p> } else if(direction == 'right' && (parseInt(visibleSectionCasesList.css('width')) * -1) + parseInt($('section').css('width')) + 30 <= listPosition){</p><p> fadeAnimation = visibleSectionCasesList.animate({</p><p> left : listPosition - 30</p><p> </p><p> }, (scrollSpeedAdjust * 200));</p><p> }</p><p> </p><p> </p><p> // check button visibility</p><p> // right arrow button</p><p> if (visibleSectionCasesList.length <= 0 || (parseInt(visibleSectionCasesList.css('left')) - $('section').width()) * -1 == parseInt(visibleSectionCasesList.css('width'))) {</p><p> $('.arrow-right').hide();</p><p> } else {</p><p> $('.arrow-right').show();</p><p> }</p><p> </p><p> // left arrow button</p><p> if (visibleSectionCasesList.length <= 0 || parseInt(visibleSectionCasesList.css('left')) == 0) {</p><p> $('.arrow-left').hide();</p><p> } else {</p><p> $('.arrow-left').show();</p><p> }</p><p> });</p><p></p><p>[/CODE]</p></blockquote><p></p>
[QUOTE="Karol, post: 2234675, member: 537889"] Hi, ich verzweifle an der Aufgabe Crome klar zumachen sich wie die anderen Browser zu verhalten. Ich habe auf der Website [URL="http://smz.de"]www.smz.de [/URL]hauptsächlich die Gestaltung, HTML und CSS umgesetzt. Das Java Script wurde von einer ehemaligen Mitarbeiterin geschrieben zu der ich leider kein Kontakt mehr habe. Da ich im Java Script Bereich noch ein Neuling bin kriege ich das Problem ohne Hilfe nicht in den Griff. Alle anderen Browser führen den Code richtig aus nur Crome lässt alle <li> stehen und bewegt das enthaltene <object>. Ich wäre sehr dankbar wenn jemand eine Idee hätte dem engegenzuwirken oder findet jemand einen Fehler im Code? [CODE] // Scroll cases var scrollAnimation, fadeAnimation, scrollSpeed = 0, // higher number = slower scroll, must be > 0 scrollSpeedAdjust = 1.6, listPosition; function scrollCases(visibleSectionCasesList, direction, e){ var listPosition = parseInt(visibleSectionCasesList.css('left')); // check if we leave maxwidth of the caseslist if(direction == 'left' && listPosition <= 0){ scrollSpeed = scrollSpeedAdjust * (listPosition * -1 + (visibleSectionCasesList.width() / 10)); scrollAnimation = visibleSectionCasesList.animate({ left : 0 }, scrollSpeed); } else if(direction == 'right' && (parseInt(visibleSectionCasesList.css('width')) * -1) + parseInt($('section').css('width')) <= listPosition){ scrollSpeed = scrollSpeedAdjust * (visibleSectionCasesList.width() + listPosition); scrollAnimation = visibleSectionCasesList.animate({ left : (visibleSectionCasesList.width() * -1) + $(window).width() }, scrollSpeed); } else { // trigger mouseout to one of both links to stop scrolling right/left and check arrow visibility $('.arrow-right').trigger('mouseout'); } } // start scrolling cases when mouseover the hidden links $('.arrow-right, .arrow-left').on('mouseover', function(e){ if(typeof scrollAnimation != 'undefined') { scrollAnimation.stop(); } if(typeof fadeAnimation != 'undefined') { fadeAnimation.stop(); } var visibleSection = $('section:eq(' + ($(window).scrollTop() / $(window).height())+ ')'), visibleSectionCasesList = visibleSection.find('ul, object'), direction = $(this).attr('data-direction'); scrollCases(visibleSectionCasesList, direction, e); }).on('mouseout', function(){ var visibleSection = $('section:eq(' + ($(window).scrollTop() / $(window).height())+ ')'), visibleSectionCasesList = visibleSection.find('ul, object'), listPosition = parseInt(visibleSectionCasesList.css('left')), direction = $(this).attr('data-direction'); // stop scroll animation scrollAnimation.stop(); if(direction == 'left' && (listPosition + 30) <= 0){ fadeAnimation = visibleSectionCasesList.animate({ left : listPosition + 30 }, 200); } else if(direction == 'right' && (parseInt(visibleSectionCasesList.css('width')) * -1) + parseInt($('section').css('width')) + 30 <= listPosition){ fadeAnimation = visibleSectionCasesList.animate({ left : listPosition - 30 }, (scrollSpeedAdjust * 200)); } // check button visibility // right arrow button if (visibleSectionCasesList.length <= 0 || (parseInt(visibleSectionCasesList.css('left')) - $('section').width()) * -1 == parseInt(visibleSectionCasesList.css('width'))) { $('.arrow-right').hide(); } else { $('.arrow-right').show(); } // left arrow button if (visibleSectionCasesList.length <= 0 || parseInt(visibleSectionCasesList.css('left')) == 0) { $('.arrow-left').hide(); } else { $('.arrow-left').show(); } }); [/CODE] [/QUOTE]
Bilder bitte
hier hochladen
und danach über das Bild-Icon (Direktlink vorher kopieren) platzieren.
Zitate einfügen…
Authentifizierung
Wenn ▲ = 5, ▼ = 2 und ■ = 7, was ist ▲ × ▼ + ■?
Antworten
Start
Forum
Sonstiges
Webdesign, Webentwicklung & Programmierung
PHP, Javascript, jQuery, Ajax, nodeJS, MySQL...
Crome ignoriert meine js Scroll Animation bei eingebundenen Objekten
Oben