Below are the steps I have followed to quickly incorporate a jQuery widget in a Visual Web Part deployed in Office 365/SharePoint Online. I have used the Accordion widget of jQuery UI for this demonstration.
The output of this demonstration.
1. Let us start by creating a SharePoint sandboxed solution in our Visual Studio. It contains a Visual Web Part and a Module that holds the .js file for our visual web part.
3. The Prototype.js file contains the function for the accordion in this demonstration.
4. Finally, let us build our solution, deploy it in the solution gallery of our SharePoint Online, and then let us activate it to enjoy the incorporation of jQuery and visual web part in our SharePoint Online.
Hope this would help.