A tri-state buffer or inverting buffer looks like a regular buffer or inverter, except there is an additional "enable" control signal entering the gate. When the enable is "1" the buffer is driving the output; when the enable is "0," the output is turned off ("tri-stated").
The 74ls240 is a bit more complex...kinda. It can also take its input and output the opposite depending on the G pin. This is what makes the 74ls240 different. The output is determined by pins G (1G or 2G) and pin 1A(1-4)/2A(1-4).
When the G input is high, the output is "Z" and no electrical current flows through no matter if pins 1A(1-4)/2A(1-4) is high/low.