Standard Hover / Pop up in Visualforce Pages

Standard Hover / Pop up in Visualforce Pages

This code snippet would be helpful to popup hover in Visualforce just like in Standard Detail Page as shown in Sample Output

Sample Output

Note: Works for both Standard and Custom Objects, record.Id should be Id of Standard/Custom object.

Visualforce Page

....
your code goes here
....
<a href="#" onmouseout="LookupHoverDetail.getHover('{!record.Id}').hide();" onmouseover="LookupHoverDetail.getHover('{!record.Id}', '/{!record.Id}/m?retURL=%2F{!record.Id}&isAjaxRequest=1').show();">{!record.Name}</a>
....
your code goes here
....

NOTE: For this post Mentioned only <a> tag once can embed this in various tags lik <apex:repeat>, <apex:pageBlockSection> etc.,

Happy coding! comment below if you need any help

Subscribe to Phanindra Mangipudi

Don’t miss out on the latest issues. Sign up now to get access to the library of members-only issues.
jamie@example.com
Subscribe