40136

CSS Position Fixed not working in Chrome

I have the following webpage;

http://www.bredentacademy.co.uk/courses/bredent-group-day/

When scrolling, the box with booking information is meant to scroll down the page with the window, which works fine on Firefox, IE and Safari, but on Chrome it stays up top (despite the inspector visually laying out the box where it should be).

The Jquery to add the fixed class to the box is pretty simple;

function fixScroll() { if ($(document).scrollTop() > 295) { $('.booking_box').addClass('fixed'); } else { $('.booking_box').removeClass('fixed'); } } $(function() { $(window).on('scroll', function() { fixScroll(); }); });

And the fixed class just has these declarations;

&.fixed { float: left; position: fixed !important; top: 12px; width: 340px; @media #{$s1200} { width: 274px; } @media #{$s992} { position: inherit !important; top: auto !important; width: auto !important; } }

The box itself just sits inside a bootstrap column.

I've seen a few questions with similar issues, but can't find a solution and the whole thing is baffling me! I'm using Bootstrap, but can't see any conflicts there either.

If anybody can spot where I'm going wrong, I'd be very grateful!

Answer1:

You have added -webkit-perspective: 1000; in .mobile_panel.

.mobile_panel { -webkit-perspective: 1000; //remove this }

Remove it.. And your fixed block will work perfectly

Recommend

  • Measure SVG text dimensions without rendering
  • Where the prototype objects like HTMLParagraphElement are laying in the BOM tree?
  • How to prevent JLabel positions from resetting?
  • Imagebutton from drawable in layer-list?
  • Do tracking pixels need to have alt attributes for accessibility (WCAG 2.0)?
  • searchBar from UISearchController not showing correctly on split view on iPad
  • Managing NSNotification along with UITabBarController interactions
  • responsive table with variable column number
  • How to initialize global variable at each class invocation?
  • Reading contents of a managed bean with reflection in a JSF application
  • how to replace TreeView's selected node with newly created node
  • Storing data from SQL in array
  • Slow performance in hybrid AngularJS and Angular application in Safari
  • How to load Q library with Require.js?
  • Cursor in wrong place in contenteditable
  • Rails 5 - Google Maps - Javascript error - initMap is not a function - fixing one js issue creates a
  • Setting src to Base64-encoded image with Javascript is failing
  • Is it safe to drop the -webkit vendor prefix from the css3 border-radius yet?
  • Unable to click on the next page button containing “>” sign
  • Is there a way to set up a fallback for the formAction attribute in HTML5?
  • Problems with toDataURL HTML5 other ways to get canvas data?
  • AppleScript : find open tab in safari by name and open it
  • Is playing sound in Javascript performance heavy?
  • Android full screen on only one activity?
  • Chrome doesn't support silverlight anymore? How to solve this?
  • Change multiple background-images with jQuery
  • Algorithm for a smudge tool?
  • Display issues when we change from one jquery mobile page to another in firefox
  • Ajax jQuery multiple calls at the same time - long wait for answer and not able to cancel
  • Can Jackson SerializationFeature be overridden per field or class?
  • Javascript convert timezone issue
  • jQuery tmpl and DataLink beta
  • How to disable jQuery.jplayer autoplay?
  • Android Studio and gradle
  • CSS Applying specific rule for a specific monitor resolution with only CSS is posible?
  • Angular 2 constructor injection vs direct access
  • Java static initializers and reflection
  • Setting background image for body element in xhtml (for different monitors and resolutions)
  • Android Google Maps API OnLocationChanged only called once
  • UserPrincipal.Current returns apppool on IIS