Note that there are some explanatory texts on larger screens.

plurals
  1. POJavascript inside HTML does not work to display a specific div
    primarykey
    data
    text
    <p>I have a javascript code inside my HTML. Here's the code: </p> <pre><code>&lt;body&gt; &lt;div id="div_inner_title"&gt; &lt;img class="img_title" src="../common/img/header_logo.png"&gt;&lt;/img&gt; &lt;a id="menuId"&gt;&lt;img class="img_menu" src="img/btn_menu.png"&gt;&lt;/img&gt;&lt;/a&gt; &lt;script type='text/javascript'&gt; $(document).ready(function (){ $("#menuId").click(function (){ $('html, body').animate({ scrollTop: $("#div_menu_links").offset().top }, 1000); }); });&lt;/script&gt; &lt;/div&gt; . . . . .&lt;!--Somewhere really below is a menu--&gt; . . &lt;div class="div_menu_links"&gt; &lt;a href="...."&gt; &lt;img src="../common/img/menu_01.png" class="img_menu_button"&gt;&lt;/img&gt; &lt;/a&gt; &lt;img class="img_menu_line_button" src="../common/img/menu_line.gif"&gt;&lt;/img&gt; &lt;a href="...."&gt; &lt;img src="../common/img/menu_02.png" class="img_menu_button"&gt;&lt;/img&gt; &lt;/a&gt; &lt;img class="img_menu_line_button" src="../common/img/menu_line.gif" &gt;&lt;/img&gt; &lt;a href="...."&gt; &lt;img src="../common/img/menu_03.png" class="img_menu_button"&gt;&lt;/img&gt; &lt;/a&gt; &lt;img class="img_menu_line_button" src="../common/img/menu_line.gif"&gt;&lt;/img&gt; &lt;a href="...."&gt; &lt;img src="../common/img/menu_04.png"class="img_menu_button"&gt;&lt;/img&gt; &lt;/a&gt; &lt;/div&gt; &lt;/body&gt; </code></pre> <p>What I really wanted to do is when the user clicks the image button with javascript, the div menu is displayed on the screen (since it is located way down in the actual website). However, the above code does not work. Just for additional info, the "transfer" from the image button to the div menu has an animated effect.</p> <p>To be honest, I am not super genius programmer so please do help me. This is the only thing left not working on my page. Thanks! </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