Note that there are some explanatory texts on larger screens.

plurals
  1. POCode to toggle HTML-elements is called twice
    primarykey
    data
    text
    <pre><code>// Here based on the class rply1 I am displaying replies &lt;div class="biz_gary_btn width80 pl5 fl rply1&lt;?php echo $comm['comment_id'];?&gt;"&gt; &lt;div class="fl pt5_ie pt1"&gt;&lt;img src="&lt;?php echo base_url();?&gt;images/green_callot.png" alt="Green Callot"&gt;&lt;/div&gt; &lt;div class="arial bold fnt11 c7b7b7b fl pl5 "&gt;2 Replies &lt;/div&gt; &lt;/div&gt; &lt;!--2 Replies--&gt; &lt;!--Reply--&gt; &lt;div class="biz_gary_btn width84 pl5 fl rply2&lt;?php echo $comm['comment_id'];?&gt;"&gt; &lt;div class="fl pt5_ie pt1 pl5"&gt;&lt;img src="&lt;?php echo base_url();?&gt;images/light_blue_callot.png" alt="Blue Callot"&gt;&lt;/div&gt; &lt;div class="arial bold fnt11 c7b7b7b fl pl7"&gt;Reply&lt;/div&gt; &lt;/div&gt; </code></pre> <p>This is the script</p> <pre><code>&lt;script type="text/javascript"&gt; $(document).ready(function(){ $(".rply1&lt;?php echo $comm['comment_id'];?&gt;").click(function(){ alert("sdfsd"); //return true; $("#2replies&lt;?php echo $comm['comment_id'];?&gt;").toggle(); $(".rply1&lt;?php echo $comm['comment_id'];?&gt;").toggleClass("advice_white_btn_active"); }); $(".rply2&lt;?php echo $comm['comment_id'];?&gt;").click(function(){ $("#reply&lt;?php echo $comm['comment_id'];?&gt;").toggle(); $(".rply2&lt;?php echo $comm['comment_id'];?&gt;").toggleClass("advice_white_btn_active"); }); }); &lt;/script&gt; </code></pre> <p>But the function is being called twice. I can see the alert twice. After the first alert my <code>#2replies</code> div is visible. This working just fine in the HTML set-up.</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.
 

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