When sexual jokes are made in the workplace, it's often done at a worker's expense. This worker may then claim sexual harassment for having been subjected to these jokes, often repeatedly.
However, it's important to note that this type of direct targeting isn't always necessary. In fact, there have been cases where courts have decided that a hostile work environment had been created simply because these types of jokes were told repeatedly, even though the person who eventually complained had not been referenced or directly targeted.
Moreover, in one case, that person was never even told the sexually-themed jokes directly; they were just presented in the environment in which the person worked, in a place where that worker could encounter them.
That case also involved off-color cartoons. These cartoons had been displayed in the workplace, but there was not a clear division of genders. Men sometimes posted them, while women were responsible for them on other occasions.
Even so, the court determined that these jokes should not have been considered humorous and should not have been said or displayed in the workplace. Since the employee was then subjected to seeing and hearing them, regardless of the employee's own preferences, it was deemed to be a hostile work environment. The actions of the workers involved with the jokes infringed on the basic rights of the other employees, who deserved to have an office where they felt comfortable.
This example shows that not all sexual harassment cases fit the stereotype. They don't always have the same type of malicious approach. Regardless, it's important for workers to know their legal options when they feel that lines have been crossed.
Source: UCLA, "What Speech Does "Hostile Work Environment" Harassment Law Restrict?," Prof. Eugene Volokh, accessed June 30, 2017