How to create an image or an object that can be moved with the mouse? Circular, vertical and horizontal movement, etc. Or a three-dimensional movement Like the attached picture, which is on one of the websites. Moving the cup in all directions is controlled by the mouse.
You expect something which exceeds the possibilities of Illustrator and Photoshop. Illustrator can produce the mug without a handle with 3D revolve effect. Even the surface image can be placed. Photoshop has no 3D modelling tools. The model must be made elsewhere. But Photoshop can show it and help in placing the image on the surface.
Even in entry level 3D software the case takes only few minutes. Here's the mug and the handle as separate objects. They are made by revolving a freeform cross-section profile and pulling an ellipse along a half circle. The image is a screenshot of your question.
The handle is moved:
And this is another view of the result:
The creation of the parts take less than 5 minutes. You must save the result in some common 3D format if you are going to show it in a 3D viewer on a web page. I must skip the web page details due the lack of web programming skills.