Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript Code to show div boxes not working in Firefox
    primarykey
    data
    text
    <p>I have this piece of Javascript Code that works great on Chrome and Internet Explorer but I can't get it to work in Firefox</p> <pre><code> &lt;script src="jquery-1.10.2.js"&gt;&lt;/script&gt; &lt;script src="jquery-1.10.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; function aufklappen(id, arr) { $('.3').attr("src", "images/leftarrow.png"); var style = $("div[id='" + id + "']").attr("style"); $('.2').hide(); if (style == "display: none;") { var elem = document.getElementById(id); elem.style.display = "block"; $("#" + arr).attr("src", "images/downarrow.png"); } else { var elem = document.getElementById(id); elem.style.display = "none"; $("#" + arr).attr("src", "images/leftarrow.png"); } } &lt;/script&gt; </code></pre> <p>I have a code getting data out of a mysql database displaying some basic data. What I am trying to do is to show a hidden div box, which contains more details, when I click on an image. In addition I want to change this picture to show an arrow that's pointing down. If someone clicks on one of these images I first want to hide all divs so that there is only one hidden div box shown at a time. Every image has <code>class="3"</code> and every hidden div box <code>class="2"</code>. The ID's are created dynamically so I can show the div box I want. I call the function with this code:</p> <pre><code>&lt;a onclick='aufklappen("&lt;? echo $flightnum;?&gt;2", "&lt;? echo $flightnum;?&gt;arr")'&gt;&lt;img class="3" id="&lt;? echo $flightnum;?&gt;arr" src="images/leftarrow.png" /&gt;&lt;/a&gt; </code></pre>
    singulars
    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.
 

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