Fog-aided Internet of Things (IoT) networks provide low latency IoT services by offloading computational intensive and delay sensitive tasks to the fog nodes, which are deployed close to the IoT devices. Mobile IoT relies on battery limited mobile IoT devices (e.g., wearable devices and smartphones) to provision networks with enhanced flexibility. Mobile IoT faces the challenges of varying wireless channel conditions and hence may degrade the quality of service (QoS). We investigate the task allocation, which intelligently distributes tasks to different fog nodes and adapts to IoT varying mobile environment, such that the average task completion latency, constrained by QoS requirements and mobile IoT device battery capacity, is minimized. An integer linear programming (ILP) problem is then formulated to solve this problem. However, it is difficult to obtain the user mobility patterns (i.e., future locations where tasks are offloaded) and user side information (i.e., task length and computing intensity). Therefore, we propose an online learning algorithm to engineer task allocation decisions and then demonstrate its performances by extensive simulations.