Yosef’s brothers were not too fond of him in any case, but they hated him even more for the dreams that he had. Each dream he told them about would increase their hatred of him. They even rebuked him when the interpretation of his dreams put them in an inferior light. But then he had a dream that put them in exactly the same inferior light as the previous one, but not only did they not rebuke him, but instead of increasing their hatred of him further we are told that they became jealous of him. 
Of course when we mention the traits of ‘hatred’ and ‘jealousy’ that these great spiritual giants had for family members they must be understood in context – relative to the lofty levels of those being discussed. But nonetheless, what changed that Yosef’s brothers first hate him, but were then only jealous of him?
‘Avraham Netzach’ was enslaved twenty years in Soviet anti-Semitic slave-labour camps for practicing Judaism. Miraculously he survived and eventually immigrated to Jerusalem. Remarkably, throughout his experiences, he remained openly faithful to his religious principles, so much so that he was known as ‘Subotta’ (Russian for Shabbos) since he never worked on Shabbos.
Avraham paid dearly for his refusal to work on Shabbos. On one such occasion he was sent to the ‘hole’ – an isolated prison within the camp (nicknamed ‘Cold Hell’) which was normally reserved for murderers with long terms. When the administration wanted to rid themselves of a prisoner they would send him there.
He knew from his previous experiences that his only hope at survival would be by appearing fearless. He chose a place, read the Shema prayer, hung his clothes up to dry and lay down to sleep – he was exhausted after a long day of dangerous back breaking labour. Shortly afterwards he felt a sharp pain: one of the prisoners was standing over him with a club.
“Looks like you don’t know where you are,” the murderer spoke up, “come down from your bunk and say your confession to your Jew-G-d – you will not leave here alive”.
“If that’s the case”, replied Avraham, “Leave me be and let me at least rest in the meantime”. And with that he pretended to go back to sleep, when suddenly he was struck by the club again.
Avraham jumped up and demanded “Who is the batko (‘father’, i.e. leader) around here?”
“Who do you think you are?” the batko spoke up, approaching Avraham, “why should we introduce ourselves to you?”
“I am no better than you,” Avraham replied, “but if I am to recite the confession I need to know what sin it is that I did that you are going to kill me for”
“You know, I am beginning to like this guy,” the batko smiled. “They say that you are a religious and political enemy of the country. But when you came here you weren’t afraid and acted just like one of the boys – I’m confused!”
“What is there to understand,” Avraham responded, “they must have promised you some reward to do away with me and then they’ll try you for murder and execute you: that way they’ll get rid of us all – letting us kill off one another.”
A conversation developed and before they knew it, it was dawn. Two prisoners went out to fetch breakfast and the batko even gave Avraham two portions of bread and some sugar (considered a delicacy) as well, commenting, “You will need this for later: tonight is Shabbos – Ah! I remember how my Jewish neighbours used to keep Shabbos with fresh clothes, tasty food, beautiful singing… Ah!”
That night was Shabbos and Avraham, undisturbed, experienced – in the ‘hole’ amongst murderers – one of his most peaceful Shabbos’s throughout his stay at the camp!
‘Differences’ between two parties often lead to hatred. But sometimes this difference is not because ‘he is different (to me)’ but because ‘I am different (to him)’, or in other words ‘why can’t he just be like me?’ or ‘why can’t I just be like him?’ (respectively).
These diametrically opposed responses essentially correspond (respectively) to the evil trait of jealousy or (in the case of a positive ‘difference’) the healthy, even essential trait of ‘kinas sofrim’  – a positive ‘jealousy’ diverting the potential feelings of hatred and jealousy of a persons’ differences to an appreciation of them and a subsequent desire to emulate them.
As mentioned, like Yosef, his brothers were also on a very lofty spiritual level. Perhaps their initial ‘hatred’ of him was for his differences to them. But once they entertained that these differences might be due to Yosef’s superiority over them rather than theirs over him, they had ‘kinas sofrim’ – healthy ‘jealousy’ for him.
Of course it takes time to completely integrate this attitude, but when it is internalised it can subsequently even dispel hatred.
Have a jollyous Subotta,
Story: Subotta, ch. 17 (recommended read!) Bereishis 37:1-11  Bava Basra 21a