add css rule using jquery

后端 未结 2 1099
渐次进展
渐次进展 2020-12-19 11:32

i got a css rule like this:

#imgwrapper {display: block;position: relative;width:auto;height:auto;}

so i got a hyperlink that when it\'s cl

相关标签:
2条回答
  • 2020-12-19 12:04

    the following code should work.

    $('#imgwrapper').css('cursor','crosshair')
    
    0 讨论(0)
  • 2020-12-19 12:13

    See the $.css() function

    $('a.whatever').click(function() {
      $('#imgtarget').css('cursor' , 'crosshair');
      $('#imgwrapper img').css('cursor', 'crosshair');
    });
    
    0 讨论(0)
提交回复
热议问题