javascript - CSS style not functioning with jquery -


i have html file has 2 images areas mapped , marked imagemapster. want 1 of images superimposed on , above image can dragged around. although quite close achieving intend, going wrong. image drag-able default positon of image below first image. want on top of other. reduced opacity. when page reloaded, seems superimposed fraction of second. statements inside style not working supposed to. can guess being overridden jquery-ui or other styles. can point out how fix this?

locate.html.erb

<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script> <script src="https://ajax.googleapis.com/ajax/libs/jqueryui/1.11.4/jquery-ui.min.js"></script> <script src="/assets/jquery.imagemapster.min.js"></script> <script src="/assets/threeddata.js"></script>  <style> img {     position: absolute; } #mainimage2 {     opacity: 0.6; } </style>  <h1>data archival library</h1> </div>  <img id="mainimage" src="/assets/pic.png" usemap="#mark"> <map name="mark">     <script type="text/javascript">     document.write('<area href="#bottom" select="red1" shape="rect" coords="'+rowrackcoords.join(",")+'">');     </script> </map>  <div class="ui-widget-content" id="draggable"> <img id="mainimage2" src="/assets/unnamed.png" usemap="#mark2"> <map name="mark2">     <script type="text/javascript">     document.write('<area href="#top" select="red2" shape="rect" coords="'+shelfboxcoords.join(",")+'">');     </script> </map> </div> 

.js

$(document).ready(function () {     $('#mainimage').mapster({         singleselect : false,         clicknavigate: true,         mapkey: 'select',         fill : true, altimage: '/assets/pic2.png',         areas : [{key : 'red1', selected : true,}],     }); });  $(document).ready(function () {     $('#mainimage2').mapster({         singleselect : false,         clicknavigate: true,         mapkey: 'select',         fill : true,         fillcolor : '00ff00',         fillopacity : 0.5,         areas : [{key : 'red2', selected : true}],     }); });  $(document).ready(function () {      $(function () {         $("#draggable").draggable();     }); }); 

first should begin 1 $(document).ready(function () {}); :

$(document).ready(function () {     $('#mainimage').mapster({         singleselect : false,         clicknavigate: true,         mapkey: 'select',         altimage: '/assets/pic2.png',         areas : [{key : 'red1', selected : true,}],     });     $('#mainimage2').mapster({         singleselect : false,         clicknavigate: true,         mapkey: 'select',         fillcolor : '00ff00',         fillopacity : 0.5,         areas : [{key : 'red2', selected : true}],     });     $("#draggable").draggable(); }); 

i haven't test it, better start point.

edit : removed fill : true, because it's mapster default value


Comments

Popular posts from this blog

Android : Making Listview full screen -

javascript - Parse JSON from the body of the POST -

javascript - How to Hide Date Menu from Datepicker in yii2 -