Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>mm.............. since i dont know what is your programinng lanuage and other stuff . this may not useful to you , but if you are using zend framework , this is the way to do it .</p> <p>create a session variable in your controller's init method</p> <pre><code>functiion init() { $defaultNamespace = new Zend_Session_Namespace('Default'); $defaultNamespace-&gt;divnumber = 1 ; } </code></pre> <p>then in your action you sholud pass it to the view </p> <pre><code>public function divchangeAction{ $this-&gt;view-&gt;currentdiv = $defaultNamespace-&gt;divnumber ; } </code></pre> <p>in your view .it is divchange.phtml</p> <pre><code>&lt;script lanuage='javascript'&gt; //get the session variable var divnumber = &lt;?php echo $this-&gt;currentdiv ; ?&gt;; $(document).ready(funcction(){ //hide the divs $('#divone').hide(); $('#divtwo').hide(); $('#divthree').hide(); //show one div if(divnumber==1){ $('#divone').show(); } else if(divnumber==2) { $('#divtwo').show(); } else { $('#divthree').show(); } //increase the divnumber value divnumber = divnumber + 1 ; if(divnumber &gt;3) { divnumber = 1 ; } //pass new div number to the controller's changecache action and update the session variable $.post("baseurl/changecache", {divnumber : divnumber}, function(data) { }); }); </code></pre> <p>in your changecacheAction </p> <pre><code>public function changecacheAction() { //take the div number $divnumber = $_POST['divnumber']; //update session variable $defaultNamespace-&gt;divnumber = $divnumber ; } </code></pre> <p>this is the way to do it in zend framework , remember that you can't do it along in client side . because when page is refreshing , client side varibles restore , you sholud use a session or cookie . :)</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload