Praise be to Allah.
It is prohibited to stun the animals by stroking or using electricity for these kinds of stunning hurt the animal and the Prophet (Peace be upon Him) interdicts us from torturing or hurting animals and on the contrary ordered us to be kind and benevolent with them especially at slaughtering. Imam Ahmad narrated on the authority of Ibn Abbas that the Prophet (Peace be upon Him) passed by a group from Al-Ansar (the supporters) while they were aiming at a pigeon. The Prophet said: "Don’t make an aim from an alive creature".
Saeed Ibn-Gobair narrated that Ibn-Ommar had passed by some youth from Koraish while they were aiming at a bird and in return for their missed shoots they gave the owner of the bird the arrows. When the youth saw Ibn-Ommar, they ran away so Ibn-Ommar said: "Who did that? Allah curses the one who did that. The prophet (Peace be upon Him) curses any one who takes an alive creature as an aim".Narrated by Muslim # 3619
Imam Muslim narrated on the authority of Ibn-Gaber Ibn-Abdullah, may Allah be pleased with them, that the Prophet "forbids us from leaving animals tied without food or drinks until death" (No. 3620)
Also, Imam Muslim narrated that Shadad Ibn-Aws said: "I have kept in heart two points from our Prophet (Peace be upon Him). Allah orders us to refine every thing we do. When killing enemies, kill properly, and when slaughtering animals slaughter properly. So the one in change of slaughtering must sharpen his blade to comfort his slaughtered animal.
There are many other evidences that prove the importance of being kind and benevolent with animals.
In short, it is unlawful to stun the animal before slaughtering because stunning hurts the animal and Allah forbids us from doing that except in necessary when the animal is out of control at slaughtering and it is difficult to catch it so it is then lawful to resort to partial stunning to control the animal and in turn it would be lawful to be eaten if it is slaughtered alive.
This stunning is permitted only if it doesn’t lead to death of the animal for if that happened it would be unlawful to be eaten as Allah the Almighty said in His Holy Book:
"Forbidden to you (for food) are: dead meat, blood, the flesh of swine, and that on which hath been invoked the name of other than Allah, that which hath been killed by strangling, or by a violent blow, or by a head long fall, or by being gored to death, that which hath been (partly) eaten by a wild animal, unless ye are able to slaughter it (in due from), that which is sacrificed on stone (altars); (forbidden) also is the division (of meat) by raffling with arrow: that is impiety." (Al-Maidah # 3)
And Allah knows best, and Peace & Blessing be upon His Messenger Mohammed and his companions.