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
Praveen Kumar 212Praveen Kumar 212 

Javascript instead of Controller methods

Hi All,
Here is my small code snippet. I have implemented the modal popup using CSS  and action:function. I want to do this toggle effect without using controller. So that i can implement everything in the VF page itself. Help! :)
<apex:page controller="dumm" >
 <apex:form id="form" >
   <apex:image id="theImage" onmouseover="showPopup()" onmouseout="hidePopup()"  value= "{!$Resource.EC2Console_RebootImage}" width="30" height="30"/>
    <apex:actionFunction action="{!showPopUp}" name="showPopup" reRender="form" />
    <apex:actionFunction action="{!closePopup}" name="hidePopup" reRender="theIframe" />
    <apex:outputPanel id="tstpopup">
        <apex:outputPanel styleClass="popupBackground"   layout="block" rendered="{!displayPopUp}"/>
            <apex:outputPanel styleClass="custPopup"  rendered="{!displayPopUp}">
               <apex:commandButton value="Close" action="{!closePopup}" rerender="tstpopup"/>
                <apex:iframe src=""  scrolling="true" height="300"></apex:iframe></apex:outputPanel>
<style type="text/css">
            background-color: white;
            border-width: 2px;
            border-style: solid;
            z-index: 9999;
            left: 50%;
            position: absolute;
            width: 700px;
            margin-left: -250px;
            opacity: 0.20;
            filter: alpha(opacity = 20);
            position: absolute;
            width: 100%;
            height: 100%;
            top: 0;
            left: 0;
            z-index: 9998;


public with sharing class dumm {

    public dumm(ApexPages.StandardController controller) {


public boolean displayPopup {get; set;} 
    public dumm(){
        displayPopup = false;
    public void closePopup() {        
        displayPopup = false;    
    public void showPopup() {        
        displayPopup = true;    

Amit Chaudhary 8Amit Chaudhary 8
Please check below post. I hope that will help you

How to create popup by clicking a custom button in a standard page layout in Salesforce
var iframe_url = '{!URLFOR("/apex/[your_visualforce_page]")}';
var j$modalDialog = j$('<div></div>')
       .html('<iframe id="iframeContentId" src="' + iframe_url + '" frameborder="0" height="100%" width="100%" marginheight="0" marginwidth="0" scrolling="no" />')
            autoOpen: false,
            title: 'My Modal Dialog',
            resizable: false,
            width: 400,
            height: 400,
            autoResize: true,
            modal: true,
            draggable: false

Please let us know if this will help you

You can use Jquery Modal box (colorbox)
Please refer to the link :