Note that there are some explanatory texts on larger screens.

plurals
  1. PODisplay a div on click of an anchor via jquery
    primarykey
    data
    text
    <p>Whenever I click on the anchor i want the div popup content to get displayed.But with this code it is not happening.</p> <pre><code> &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"&gt; &lt;head&gt; &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8" /&gt; &lt;title&gt;ZoomMap Example&lt;/title&gt; &lt;link rel="stylesheet" type="text/css" href="mymap.css" /&gt; &lt;script type="text/javascript" src="jquery-1.3.2.min.js"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function(){ $("#id1").click(function(){ $(".popupcontent").animate({opacity:1.0}); }); }); &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;h1&gt;Manana&lt;/h1&gt; &lt;div id="container"&gt; &lt;div id="map"&gt; &lt;img src="images/map.png"/&gt; &lt;a class="pointer" id="id1" href="#" &gt;a &lt;/a&gt; &lt;a class="pointer" id="id2" href="#" &gt; &lt;/a&gt; &lt;a class="pointer" id="id3" href="#" &gt; &lt;/a&gt; &lt;a class="pointer" id="id4" href="#" &gt; &lt;/a&gt; &lt;a class="pointer" id="id5" href="#" &gt; &lt;/a&gt; &lt;div class="popupcontent"&gt; &lt;p&gt;&lt;/p&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>the <code>css</code> file contains the following code. I have made the opacity of this div 0 so that it remains hidden initially. When user clicks on a link i have changed the opacity to 1 using animate. But still it is not getting displayed</p> <pre><code> body{ margin:0; padding:0; } #map{ dsplay:block; margin:0; padding:0; width:600px; height:300px; position:absolute; top:20%; left:20%; } #map img{ margin:0; padding:0; width:600px; height:300px; z-index:1; } #map .pointer{ margin:0; padding:0; display: block; position: absolute; width: 5px; height: 5px; background: red; text-decoration: none; border: 1px solid red; opacity: .7; z-index:2; } #map a.bullet { z-index: 2; } #map #id1{ left:123px; top:40px; } #map #id2{ left:90px; top:210px; } #map #id3{ left:225px; top:20px; } #map #id4{ left:320px; top:195px; } #map #id5{ left:425px; top:20px; } #map .popupcontent{ background-color:yellow; border-style:groove; border-color:grey; height:100px; width:150px; position:absolute; top:30%; left:30%; opacity:0; z-index:13; } #map .popupcontent p{ } </code></pre> <p>I have placed these links on the top of an image. </p>
    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