Added width checking in javascript to only used fixed positions on small devices