0

i'm currently working on the project of mine and i have made a horizontal scrolling website.

what the problem seems to be is that when i have a scrollable div (vertically) in my horizontal webpage i can't scroll it vertically anymore.

this is the website: ShareApe 3.0

i have tried to make a mouseover event to override this scrip but i cant get it to work:

<script>
$(document).ready(function(){
  $(".main").onepage_scroll({
    sectionContainer: "section",
    responsiveFallback: 600
  });
});
</script>

so what i want to do is when your mouse hovers over the file selection "Drag & Drop files" part of the website i want this function to be disabled.

Manny thanks for your time!

update:

i have used this working code:

<script>
$(document).ready(function(){
$('#fileUpload').on('mousewheel', function(e) {
    e.stopPropagation();
});
});
</script>

its working but not for Firefox.

so i have tried to add some code and its not working for me:

    <script>
$(document).ready(function(){
$('#fileUpload').on('mousewheel', function(e) {
    e.stopPropagation();
});
});

var mousewheelevt=(/Firefox/i.test(navigator.userAgent))? "DOMMouseScroll" : "mousewheel" //FF doesn't recognize mousewheel as of FF3.x

if (slideshow.attachEvent) //if IE (and Opera depending on user setting)
slideshow.attachEvent("on"+mousewheelevt, rotateimage)

else if (slideshow.addEventListener) //WC3 browsers
slideshow.addEventListener(mousewheelevt, rotateimage, false)

</script>

Patrick Falize

Patrick Falize
  • 599
  • 1
  • 6
  • 11

2 Answers2

2
$('#fileUpload').on('DOMMouseScroll mousewheel', function(e) {
    e.stopPropagation();
});
ArrayKnight
  • 6,956
  • 4
  • 17
  • 20
  • the strange thing is thad if i put this into the chrome console it works but if i put it in it wont work :S hows that? – Patrick Falize Nov 15 '13 at 23:31
  • Are you putting it within a dom ready wrapper? Does the element exist when you're attempting to bind it? – ArrayKnight Nov 15 '13 at 23:34
  • the only thing is... its working perfectly on chrome and safari but not on firefox – Patrick Falize Nov 15 '13 at 23:40
  • Looks like you'll need to listen for two events: http://stackoverflow.com/questions/16788995/mousewheel-event-is-not-triggering-in-firefox-browser – ArrayKnight Nov 15 '13 at 23:46
  • i have tried this: – Patrick Falize Nov 15 '13 at 23:52
0

This code worked for me on all browsers i just had to add some code for firefox.

Firefox doesn't support .onmousewheel, you have to use the DOMMouseScroll event instead:

$(document).on( "mousewheel DOMMouseScroll", function(e){
    e.preventDefault();
});

oke so i figure it out. firefox has no problems with e.stopPropagation(); but the problem was with the moudewheel function. so i added "DOMMouseScroll" to the .on and it worked like a sharm!

Patrick Falize
  • 599
  • 1
  • 6
  • 11