function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Bhavdip Gadhiya 7Bhavdip Gadhiya 7 

when i put cursor on account name then account details should be display using hover and jquery?

Best Answer chosen by Bhavdip Gadhiya 7
Vasani ParthVasani Parth
Bhavdip,
You can try below example,
Visualforce page
<apex:page controller="PopupTest">
 <apex:form > 
<apex:repeat value="{!accounts}" var="acc"> <br/> 
<a href="/{!acc.Id}" id="{!acc.Id}" onblur="LookupHoverDetail.getHover('{!acc.Id}').hide();" onfocus="LookupHoverDetail.getHover('{!acc.Id}', '/{!acc.Id}/m?retURL=%2F{!acc.Id}&isAjaxRequest=1').show();" onmouseout="LookupHoverDetail.getHover('{!acc.Id}').hide();" onmouseover="LookupHoverDetail.getHover('{!acc.Id}', '/{!acc.Id}/m?retURL=%2F{!acc.Id}&isAjaxRequest=1').show();">{
!acc.Name}</a>
 </apex:repeat> 
</apex:form> 
</apex:page>
Controller
public with sharing class PopupTest {
 public List getAccounts() {
  List accounttList = new List(); 
  accounttList = [Select Id, Name from Account LIMIT 10]; return accounttList ; 
   }
 }

Please mark this as the best answer if this helps

All Answers

Bhavdip Gadhiya 7Bhavdip Gadhiya 7
VF page
<apex:page controller="accountList">
   <apex:includeScript value="{!URLFOR($Resource.Jquery, '/js/jquery-1.7.2.min.js')}"  />
    
<script>
j$ = jQuery.noConflict();
j$(document).ready(function() {
    j$("#givenAccount a").hover(function(){
            var xyz = j$('id$=select1').val();
        
        accountList.fetchAccount(xyz);
        
        j$(.showAccountDetail).show();
    });
   });
    </script>

<body>
<apex:form >
    <apex:commandButton value="List" action="{!list1}"/>  

<apex:pageBlock >
    <apex:pageBlockSection >            
<div id = "givenAccount">    
        <apex:pageblocktable value="{!listaccount}" var="a1" >    
           
            <apex:column> <a id="select1" href = "#">{!a1.name}</a>  </apex:column>       
    
    </apex:pageblocktable>
</div>        

<div class="showAccountDetail">        
    <apex:pageblocktable value="{!accountDetail}" var="a" >
        <apex:column value="{!a.name}"/>
        <apex:column value="{!a.phone}"/>
    </apex:pageblocktable>
</div>
         
</apex:pageBlockSection>
</apex:pageBlock>
</apex:form>   
</body>     
</apex:page>


apex

public class accountList{
    public list<account> listAccount{get;set;}
    public list<contact> listContact{get; set;}
    public list<account> accountDetail{get;set;}

    public pagereference list1()
    {
        listAccount = [select name,phone from account limit 10];
        listContact = [select name from contact limit 10];
    return null;
    } 

      public void fetchAccount(string id1)
    {
          system.debug('id1' + id1); 
        accountDetail = [select name,phone from account where name=:id1];
       
    }
    
}
Vasani ParthVasani Parth
Bhavdip,
You can try below example,
Visualforce page
<apex:page controller="PopupTest">
 <apex:form > 
<apex:repeat value="{!accounts}" var="acc"> <br/> 
<a href="/{!acc.Id}" id="{!acc.Id}" onblur="LookupHoverDetail.getHover('{!acc.Id}').hide();" onfocus="LookupHoverDetail.getHover('{!acc.Id}', '/{!acc.Id}/m?retURL=%2F{!acc.Id}&isAjaxRequest=1').show();" onmouseout="LookupHoverDetail.getHover('{!acc.Id}').hide();" onmouseover="LookupHoverDetail.getHover('{!acc.Id}', '/{!acc.Id}/m?retURL=%2F{!acc.Id}&isAjaxRequest=1').show();">{
!acc.Name}</a>
 </apex:repeat> 
</apex:form> 
</apex:page>
Controller
public with sharing class PopupTest {
 public List getAccounts() {
  List accounttList = new List(); 
  accounttList = [Select Id, Name from Account LIMIT 10]; return accounttList ; 
   }
 }

Please mark this as the best answer if this helps
This was selected as the best answer
Bhavdip Gadhiya 7Bhavdip Gadhiya 7
Thanks Vasani Parth.  when i put cursor on name  then display all details in other given section. Is it possible? and i m new in jquery with salesforce so how to learn jquery related salesforce any good source?