img var onClick Jquery

时间:2016-11-16 19:01:38

标签: javascript jquery angularjs onclick var

我想对此var imageCatuaba进行onclick

function setCatuaba(map) {
  var imageCatuaba = {
    url: 'images/catuskov.1.png',
    origin: new google.maps.Point(0, 0),
    anchor: new google.maps.Point(0, 32)
  };

Onclick jquery功能

$(document).ready(function(){
    $(var imageCatuaba).click(function(){
        $('.boxBAR').css('display','block')
    })
});

1 个答案:

答案 0 :(得分:-1)

如果可以帮助我不知道变量是否可以嵌入$()中。东西



$("#imageCatuaba").click(function(){
  $('.boxBAR').css('display','block')
});

div {
 background-color: lightblue;
 width: 100px;
}

.boxBar {
 display: inline; 
}

<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>

<div class="boxBar">
  <p>box</p>
</div>

<div id="imageCatuba">
  <img src=""></img>
</div>
&#13;
&#13;
&#13;