We present electron trapping in an ellipsoidal bubble which is not well explained by the spherical bubble model by [Kostyukov, Phys. Rev. Lett. 103, 175003 (2009)]. The formation of an ellipsoidal bubble, which is elongated transversely, frequently occurs when the spot size of the laser pulse is large compared to the plasma wavelength. First, we introduce the relation between the bubble size and the field slope inside the bubble in longitudinal and transverse directions. Then, we provide an ellipsoidal model of the bubble potential and investigate the electron trapping condition by numerical integration of the equations of motion. We found that the ellipsoidal model gives a significantly less restrictive trapping condition than that of the spherical bubble model. The trapping condition is compared with three-dimensional particle-in-cell simulations and the electron trajectory in test potential simulations.